A doc example embeds executable Rust code in API documentation so usage stays visible, compilable, and aligned with the implementation. section 6.11.2
A Rust doc example provides several practical benefits:
- Runs as an integration-style documentation test when cargo test executes rustdoc examples. section 6.11.2
- Lets examples omit main because rustdoc wraps the code for execution. section 6.11.2
LinkedList usage
```rust use linkedlist::LinkedList; let mut animals = LinkedList::new(); animals.append("chicken"); animals.append("ostrich"); animals.append("antelope"); ```
