Rust is a programming language. It is mostly used for performance and type safety.

Rust documentation

I am a student (as of writing this) that just wants to learn a new programming language, I am not writing Documentation for you. This article is based on my own experience and what i find in the official documentation. To learn everything about rust, go look there instead.

Honestly, this is the first time I had fun reading through the full docs of something, most of the time I just skip half of it.

Rust does not have a garbage collector, but it still guarantees memory safety, this is because of it’s “Ownership” system.

Ownership

The full documentation on ownership can be found here.

References

  • At any given time, you can have either one mutable reference or any number of immutable references.
  • References must always be valid.

Cargo

Cargo docs

Cargo has an way to export your docs as html, this auto generates docs for all your installed packages + default Rust docs. You can do this by using this command: cargo doc --open.

This documentation also has your code embedded.

Flatpack browser permissions

(This probably only applies to you when using Linux)

If you are using Flatpack for your browser, it might not be able to load the javascript, css and other html pages of the documentation. you can modify the command to specify the output dir, like the Downloads folder which my browser had access to: cargo doc --open --target-dir ~/Downloads/

Keep in mind that this does add files into your downloads folder, so you might wanna specify a sub directory like ~/Downloads/rust_project_name/