Dokumentation
Rust comes with extensive documentation. For example:
- All of the details about loops.
- Primitive types like
u8
. - Standard library types like
Option
orBinaryHeap
.
Use rustup doc --std
or https://std.rs to view the documentation.
In fact, you can document your own code:
Die Inhalte werden als Markdown behandelt. Alle veröffentlichten Rust-Bibliothekskästen (library crates) werden automatisch unter docs.rs
mit rustdoc dokumentiert. Es ist idiomatisch, alle öffentlichen Elemente in einer API mithilfe dieses Musters zu dokumentieren.
To document an item from inside the item (such as inside a module), use //!
or /*! .. */
, called "inner doc comments":
Speaker Notes
This slide should take about 5 minutes.
- Show students the generated docs for the
rand
crate at https://docs.rs/rand.