Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help


x-i18n: generated_at: “2026-03-01T14:24:29Z” model: gemini-3-flash-preview provider: google-gemini-cli source_hash: b65b3d97000dff979a58e111dcdab150284674c21b73d16a7d0745578be243fd source_path: ch14-00-more-about-cargo.md workflow: 16

关于 Cargo 和 Crates.io 的更多信息 (More About Cargo and 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) 自定义你的构建。

  • crates.io 上发布库。

  • 使用工作空间 (workspaces) 组织大型项目。

  • crates.io 安装二进制文件。

  • 使用自定义命令扩展 Cargo。

  • Customize your build through release profiles.

  • Publish libraries on crates.io.

  • Organize large projects with workspaces.

  • Install binaries from crates.io.

  • 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.