文档
Rust comes with extensive documentation. For example:
- All of the details about loops.
- ‘u8’ 等基元类型。
- Standard library types like
Option
orBinaryHeap
.
事实上,您可以为自己的代码编写文档:
The contents are treated as Markdown. All published Rust library crates are automatically documented at docs.rs
using the rustdoc tool. It is idiomatic to document all public items in an API using this pattern.
如需从项内(例如在模块内)为项编写文档,请使用 //!
或 /*! .. */
,这称为“内部文档注释”:
Speaker Notes
This slide should take about 5 minutes.
- Show students the generated docs for the
rand
crate at https://docs.rs/rand.