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
Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety. Coupled with Actix, I should be able to build a fast REST API elegantly.
rustup doc --rustup command to open the rustup book #2714.
The Rust Standard Library std is available to all Rust crates by default. Therefore, the standard library can be accessed in use statements through the path std , as in use std::env .
In the Rust development environment, all tools are installed to the ~/.cargo/bin directory, and this is where you will find the Rust toolchain, including rustc , cargo , and rustup . Accordingly, it is customary for Rust developers to include this directory in their PATH environment variable.
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}
.
Another way to have the Rust docs (and a few others from languages to frameworks to CLI tools) for offline use is to install Zeal for Linux or Dash for OS X and download Rust's documentation from there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With