Box puts a value on the heap, Rc lets several owners share one value, RefCell lets you change a value behind a shared reference, and Weak breaks the cycles that would leak memory. This part shows each one, with the counts printed.
Rust has a test runner built in. This part writes unit tests, integration tests and doc tests for a small library, reads what a failing test prints, and lets a test catch a real bug.
Modules split a Rust program into named parts, and everything in them is private until you write pub. This part covers mod, pub, paths, use, files, library and binary crates, and workspaces.
An iterator hands out items one at a time through next. This part shows how iter, iter_mut and into_iter differ, why map and filter do nothing until something consumes them, and how collect builds a Vec, a String or a map.
A closure is a small function you write in place, and it can use the variables around it. This part shows how a closure captures them, by reference, by mutable reference or by value, and what Fn, FnMut and FnOnce mean.
Generics let you write one function or struct that works for many types. This part covers type parameters, trait bounds, where clauses, impl Trait, const generics, and what the compiler really builds from a generic function.
A trait is a set of methods that many types can share. This part shows how to define and implement traits, what derive writes for you, how to make {} work with Display, and the orphan rule that decides who may write an impl.
Rust’s standard library has a small set of collections that cover most programs. This part shows Vec, HashMap and its entry API, HashSet, BTreeMap and VecDeque, what each one is good at, and how to pick.
Rust has no exceptions. A function that can fail returns a Result, and the ? operator passes the error up to its caller. This part covers panic, Result, unwrap, ?, and writing your own error type.
An enum is a value that is one of several shapes, and match makes you handle every shape. This part covers enums with data, match and its patterns, Option instead of null, if let, let else and while let.