13 Box and Rust documentation
This chapter covers
- Reading Rust documentation
- Attributes - Small bits of extra information
- Box - A smart pointer that gives a lot of extra flexibility
This chapter is a bit of a break after the last two, with Box being the only really new concept. But Box is one of the most important types in Rust, because it makes a lot of things possible that otherwise wouldn't be - especially when working with traits. You’ll definitely be glad to know it! To start off the chapter though we will relax a bit and learn how to read documentation, which in Rust is always generated in the same way. Which is nice, because once you get used to documentation in Rust you will be able to understand the documentation for anyone else's code. We'll also learn about attributes, which are the small pieces of code that start with a # that you see above a type (like #[derive(Debug)], for example) or at the beginning of a file.