Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Is there a way I can download the API library docs for Rust or generate them? The only docs I can find in the Rust source are in src/docs.

I'm running the nightly build, so I'm sure there's a way to generate all the docs in the same fashion as the standard docs using rustdoc, I just can't find it!

I'm running Linux, with the nightly build, using this command:

curl -s https://static.rust-lang.org/rustup.sh | sudo sh
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
464 views
Welcome To Ask or Share your Answers For Others

1 Answer

Rustup

If you use rustup, the recommended way to install and update Rust, then the docs may already be installed; the default installation behavior has changed over time. Try running rustup doc to open them in your browser.

If they aren't already installed, you can download the docs by running rustup component add rust-docs.

By default, rustup doc opens the documentation front page, but you can add --std to jump straight to the standard API docs or --book for The Rust Programming Language. You can also use rustup doc std::iter::Iterator to open the documentation of a specific item.

rustup 1.20 learned the concept of profiles. These allow you to default to having docs installed for a toolchain (via the default profile) or not (via the minimal profile).

Standalone Rust Installer

The Rust installer also installs the documentation for the language and for Cargo. On Linux systems, it can be found at /usr/local/share/doc/{rust,cargo}.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...