ユーザ用ツール

サイト用ツール


rust

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
rust [2021/02/15 02:02] nullponrust [2026/01/26 10:27] (現在) nullpon
行 1: 行 1:
-====== rust ======+<markdown> 
 +rust
  
-  * https://www.rust-lang.org/ +所有権システムと借用チェッカーによりGCを使用せずコンパイル時にメモリ安全性とデータ競合の排除を保証し、C/C++並みの実行速度を実現するシステムプログラミング言語。
-  * https://doc.rust-jp.rs/ +
-  * https://doc.rust-lang.org/+
  
-===== インストール =====+* https://www.rust-lang.org/ 
 +* https://doc.rust-jp.rs/ 
 +* https://doc.rust-lang.org/
  
-  * https://rustup.rs/ +## インストール
-  * https://doc.rust-lang.org/cargo/getting-started/installation.html+
  
-<code> +* https://rustup.rs/ 
-curl https://sh.rustup.rs -sSf | sh +* https://doc.rust-lang.org/cargo/getting-started/installation.html 
-</code>+ 
 +```bash 
 +curl https://sh.rustup.rs -sSf | sh 
 +```
  
 以下のコマンドがインストールされる 以下のコマンドがインストールされる
  
-  * rustup - rust言語開発環境の管理を行う +* rustup - rust言語開発環境の管理を行う 
-  * rustc - コンパイラ、直接使うことはない +* rustc - コンパイラ、直接使うことはない 
-  * cargo - パッケージ管理やビルドを行うツール、主にこれを使う +* cargo - パッケージ管理やビルドを行うツール、主にこれを使う
- +
-===== アップデート ===== +
- +
-<code> +
-$ rustup update +
-</code> +
- +
- +
-===== プロジェクト作成 ===== +
- +
-applicationを作成 +
- +
-<code> +
-$ cargo new app_name +
-</code> +
- +
-libraryを作成 +
- +
-<code> +
-$ cargo new app_name --lib +
-</code> +
- +
-===== mainファイルを変更する ===== +
- +
-Cargo.tomlに以下を設定 +
- +
-<code> +
-[[bin]] +
-name = "nyan" +
-path = "src/nyan.rs" +
- +
-[[bin]] +
-name = "wang" +
-path = "src/wang.rs" +
-</code> +
- +
-複数のバイナリを作成することも可能 +
- +
-===== 作成したアプリケーションをインストールする =====+
  
-<code> +## 新規プロジェクトの開始
-$ cargo install --path . +
-</code>+
  
-pathプロジェクトのルートを指定する。インストール先は $HOME/.cargo/bin+rustupと共にインストールされる[cargo](./cargo)を使用する
  
 +```bash
 +cargo new <project name>
 +```
  
-===== アップデート =====+## アップデート
  
-コンパイラなどのアップデート+cargo, rustcなどrustupで管理されているtoolchainを最新版にする
  
-<code>+```bash
 rustup update rustup update
-</code>+```
  
-依存ライブラリ更新+## ターゲット追加と削除
  
-<code> +例: wasm32-unknown-unknownを追加
-cargo update +
-</code>+
  
-===== rust製コマンドのインストール =====+```bash 
 +rustup target add wasm32-unknown-unknown
  
-<code> +rustup target remove wasm32-unknown-unknown 
-cargo install exa +``` 
-</code>+</markdown>
  
-  * exa: lsの置き換え 
-  * fd-find: findの置き換え 
-  * bat: catの置き換え 
rust.1613354520.txt.gz · 最終更新: by nullpon