cargo add

向 Rust 项目的 Cargo.toml 文件添加依赖项。 更多信息:https://doc.rust-lang.org/cargo/commands/cargo-add.html.

cargo add {{依赖项}}

cargo add {{依赖项}}@{{版本号}}

cargo add {{依赖项}} --features {{功能1}},{{功能2}}

cargo add {{依赖项}} --optional

cargo add --path {{path/to/directory}}

cargo add {{依赖项}} --{{dev|build}}

cargo add {{依赖项}} --no-default-features