Cargorust包管理器。用户可以通过Cargo下载、管理rust程序中的依赖项。

Cargo由rust官方创建和维护,和rust一起被安装。

Cargo命令 编辑

命令 功能 参数
help(h) 获取命令帮助 命令
new 创建新仓库 仓库名
init 在当前目录创建仓库
build(b) 编译源代码
run(r) 编译源代码并运行
check(c) 分析源代码但不编译
clean 清除编译结果
doc(d) 自动创建文档
add 添加依赖项 包名
remove 删除依赖性 包名
update 更新所有依赖性
search 搜索包 包名
test(t) 测试