Doc Comments
/// documentation.
Documentation in Rust
Rust has first-class documentation built into the language. Special comments become HTML docs generated by cargo doc.
Outer Doc Comments
Use /// to document the item that follows it — functions, structs, enums, and more. The text supports Markdown.
/// Adds two numbers together.
pub fn add(a: i32, b: i32) -> i32 {
a + b
}All lessons in this course
- Unit Tests
- Integration Tests
- Doc Comments
- Doc Tests