管理 Rust 项目及其模块依赖项(crates)。 一些子命令,如
build
,具有自己的用法文档。 更多信息:https://doc.rust-lang.org/cargo.
cargo search {{搜索关键词}}
cargo install {{包名}}
cargo install --list
cargo init --{{bin|lib}} {{path/to/directory}}
Cargo.toml
添加一个依赖:cargo add {{依赖项目}}
cargo {{[b|build]}} {{[-r|--release]}}
rustup
):cargo +nightly {{[b|build]}}
cargo {{[b|build]}} --jobs {{线程数}}