50% off 全プラン、期間限定。料金は $2.48/mo
Rust

Rust

Rust はシステムプログラミング言語です。メモリ安全で、ガベージコレクターを持たず、C と同等の速度を実現します。Stack Overflow の最も愛される言語ランキングで 8 年連続首位を獲得しており、AWS、Microsoft、Cloudflare、Discord、Linux カーネルでも採用されています。高性能システムソフトウェアの新たな標準です。

Version

Latest

Operating System

Ubuntu Server 24.04 LTS

Min. RAM

1 GB

IP Types

IPV4,IPV6

Access

Credentials:

  • User: ferris
  • Password: (stored in /root/.cloudzy-creds)

root としてサーバーに SSH し、Rust ユーザーに切り替える:

su - ferris

Important Directories

  • /home/ferris/.cargo/ → Cargo binaries (cargo, installed crates)
  • /home/ferris/.rustup/ → Rust のツールチェーンとコンポーネント
  • /home/ferris/ → ワークスペース(プロジェクトの保存先)

Useful Commands

Verify installation:

cargo --version
rustc --version

Update Rust:

rustup update

追加ツールのインストール・更新(例:リンター):

rustup component add clippy

Uninstall Rust:

rustup self uninstall

プロジェクトをビルドする:

cargo build

プロジェクトを実行する:

cargo run

Run tests:

cargo test

プロジェクトのドキュメントをビルドする:

cargo doc --open

crates.io にライブラリを公開する:

cargo publish

小さなRustアプリケーション

新しいプロジェクトを生成する:

cargo new hello-rust
cd hello-rust

デフォルトプログラムを実行する:

cargo run

CLIで依存関係を追加する:

cargo add ferris-says

次にビルドする(Cargoが依存関係を自動でインストールします):

cargo build

これにより Cargo.lock (依存関係バージョンのロックファイル)も生成されます。

Edit src/main.rs:

use ferris_says::say;
use std::io::{stdout, BufWriter};


fn main() {
    let stdout = stdout();
    let message = String::from("Hello fellow Rustaceans!");
    let width = message.chars().count();


    let mut writer = BufWriter::new(stdout.lock());
    say(&message, width, &mut writer).unwrap();
}

Run it:

cargo run

開発ツールをもっと見る

Related apps.

今すぐRustをデプロイする。 From $2.48/mo.