Rustをインストールすると、各種ツールチェーンも一緒に使えるようになります。
よく使うコマンドをまとめました。
rustup: Rustツールチェイン管理コマンド
https://github.com/rust-lang/rustup
rustup
is a toolchain multiplexer. It installs and manages many Rust toolchains and presents them all through a single set of tools …
rustupコマンドは、Rustツールチェインの管理(アップデートや stable, nightly切替え)をするために使います。
$ rustup update
$ rustup toolchain install nightly # nightlyコンパイラをインストール
$ rustup default nightly #nightlyをデフォルトとする
$ rustup default stable #stableをデフォルトとする
rustc: Rustコンパイラ
$ rusc –version
$ rustc sample.rs
cargo: Rustプロジェクトの作成コマンド
$ cargo new sample_prog –bin #実行可能ファイルを作るプロジェクト
$ cargo new sample_lib –lib #ライブラリファイルを作るプロジェクト
$ cargo build # ビルドのみ
$ cargo run #ビルド&実行
$ cargo test #ユニットテストを実行
コメント