- 7 Managing Growing Projects with Packages Crates and Modules
- 14 More About Cargo and Crates io
- 14-1 Customizing Builds with Release Profiles
- 14-2 Publishing a Crate to Crates io
- 14-2-1 Making Useful Documentation Comments
- 14-2-2 Exporting a Convenient Public API with
pub use - 14-2-3 Setting Up a Crates io Account
- 14-2-4 Adding Metadata to a New Crate
- 14-2-5 Publishing to Crates io
- 14-2-6 Publishing a New Version of an Existing Crate
- 14-2-7 Removing Versions from Crates.io with
cargo yank
- 14-3 Cargo Workspaces
- 14-4 Installing Binaries from Crates io with
cargo install - 14-5 Extending Cargo with Custom Commands
In addition to grouping functionality, encapsulating implementation details lets you reuse code at a higher level: once you’ve implemented an operation, other code can call that code via the code’s public interface without knowing how the implementation works. The way you write code defines which parts are public for other code to use and which parts are private implementation details that you reserve the right to change. This is another way to limit the amount of detail you have to keep in your head.
- Packages: A Cargo feature that lets you build, test, and share crates
- Crates: A tree of modules that produces a library or executable
- Modules and use: Let you control the organization, scope, and privacy of paths
- Paths: A way of naming an item, such as a struct, function, or module