How can I download Rust API docs?

2019-01-09 04:55发布

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
4条回答
爷、活的狠高调
2楼-- · 2019-01-09 05:35

If you're running Arch, install rust-docs and navigate to file:///usr/share/doc/rust/html/index.html.

查看更多
仙女界的扛把子
3楼-- · 2019-01-09 05:45

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.

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}.

查看更多
时光不老,我们不散
4楼-- · 2019-01-09 05:55

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.

查看更多
戒情不戒烟
5楼-- · 2019-01-09 05:58

I recommend adding a link to file:///usr/local/share/doc/rust/html/index.html in your browser/desktops bookmarks.

查看更多
登录 后发表回答