更多关于 Cargo 和 crates.io 的内容
More About Cargo and Crates.io
到目前为止,我们只使用了 Cargo 最基本的功能来构建、运行和测试我们的代码,但它能做的远不止这些。在本章中,我们将讨论它的其他一些更高级的功能,向你展示如何执行以下操作:
So far, we’ve used only the most basic features of Cargo to build, run, and test our code, but it can do a lot more. In this chapter, we’ll discuss some of its other, more advanced features to show you how to do the following:
-
通过发布配置(release profiles)自定义你的构建。
-
Customize your build through release profiles.
-
在 crates.io 上发布库。
-
Publish libraries on crates.io.
-
使用工作空间(workspaces)组织大型项目。
-
Organize large projects with workspaces.
-
从 crates.io 安装二进制文件。
-
Install binaries from crates.io.
-
使用自定义命令扩展 Cargo。
-
Extend Cargo using custom commands.
Cargo 的功能甚至比我们在本章中涵盖的内容还要多,因此有关其所有功能的完整说明,请参阅其文档。
Cargo can do even more than the functionality we cover in this chapter, so for a full explanation of all its features, see its documentation.