-
国内源加速
echo ''' export RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup export PATH="$HOME/.cargo/bin:$PATH" ''' >> ~/.profile
-
WSL
sudo apt-get install build-essential source ~/.profile curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # 切换stable版本 rustup update stable
- Windows
#用于更新 toolchain set RUSTUP_DIST_SERVER=https://mirrors.ustc.edu.cn/rust-static #用于更新 rustup set RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup # 运行rust-init.exe
# 更新 rustup update # 卸载 rustup self uninstall
- 创建项目
cargo new hello_cargo
- 编译和运行
cd hello_cargo # 编译 cargo build # 运行 cargo run
rustup doc
- Clion + Rust插件
- 《Rust 权威指南》代码
- rust-by-example
- bindgen Rust调用C/C++.