Standard Library
Checkpoints
- `Box<T>` Essential `Box<T>` is the simplest owning pointer: it holds a `T` on the heap and frees that heap memory when the `Box` itself is dropped. You'll see how `Box::new` allocates, why `Box<T>` makes recursive types (`enum List { Cons(i32, Box<List>) }`) representable, and how it is the foundational example of RAII-style memory management in Rust.
- `Option<T>` Essential `Option<T>` is the standard sum type for 'a `T` or nothing': `Some(T)` carries a value, `None` carries none. You'll see why Rust has no `null` and instead encodes absence in the type system, how `match`, `if let`, and the `?` operator make `Option` ergonomic, and the most useful helpers (`unwrap_or`, `map`, `and_then`).
- Range Types Essential Rust's range expressions `a..b`, `a..=b`, `..b`, `a..`, and `..` produce values of the `Range*` family of types in `std::ops`. You'll see what each range type contains, why they implement `Iterator` (so they work in `for` loops), and how they double as the slicing arguments behind `&v[i..j]`.
- `Result<T, E>` Essential `Result<T, E>` is the standard sum type for 'a successful `T` or an error `E`': `Ok(T)` or `Err(E)`. You'll see why Rust handles recoverable errors as values rather than exceptions, how the `?` operator turns `Result`-returning calls into clean linear code, and how `Result` and `Option` interoperate.
- `Vec<T>` Essential `Vec<T>` is Rust's growable heap-allocated array: a contiguous buffer plus a length and capacity. You'll see how `push`, `pop`, and indexing work, how the buffer grows when capacity is exceeded, why `&v[..]` gives you a slice view, and how the `Vec` releases all its memory automatically when it goes out of scope.