How to Publish Documentation to docs.rs

Publish your crate to crates.io to automatically generate and host documentation on docs.rs.

Publish documentation to docs.rs by running cargo doc locally to verify, then pushing your crate to crates.io with cargo publish, which automatically triggers docs.rs to build and host the documentation.

cargo doc --no-deps
cargo publish

Ensure your Cargo.toml includes a documentation URL pointing to https://docs.rs/YOUR_CRATE_NAME after the first successful publish.