liveBook · Manning

Cargo doc

cargo doc is a Cargo command that generates documentation for Rust packages and their dependencies.

How 2 Manning books explain it

Idiomatic Rust

cargo doc is Cargo's command for generating documentation for a Rust package and its dependencies.

How it is used
Supports API review and user onboarding by generating browsable documentation for a Rust crate.
How deep it goes
Generates HTML and explains documentation comments, but stops short of documenting advanced configuration.
Examples
Uses a linkedlist crate, LinkedList API pages, crate-level examples, and target/doc output.
What you can do after
Operate Cargo to generate documentation, inspect public APIs, and regenerate pages during editing.

Read how Idiomatic Rust explains cargo doc →

Learn Rust in a Month of Lunches

cargo doc is the Cargo command-line tool that generates documentation for Rust packages and their dependencies, with --open optionally opening the generated documentation.

How it is used
Generates local, browsable documentation for Rust code, including APIs from external crates.
How deep it goes
Explains generation, browser opening, API listings, comments, and dependency selection without covering documentation internals.
Examples
Uses DoesNothing, PrintThing, a printing method, automatic traits, blanket implementations, and /// comments.
What you can do after
Apply it via Cargo to generate and inspect documentation for a Rust project or its dependencies.

Read how Learn Rust in a Month of Lunches explains cargo doc →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.