1. Foreword
  2. Part I
  3. The Basics
    1. Installing Rust
    2. Your First Program
    3. Variables and Output
    4. Comments
    5. Arithmetic Operators
    6. Operator Precedence
    7. Comparison Operators
    8. if
    9. Scope
    10. else
    11. else if
    12. Logical Operators
    13. let mut
    14. Compound Assignment Operators
    15. stdin
    16. parse
    17. Practice Problems
    18. loop + break
    19. while
    20. for + Ranges
    21. Nested Loops
    22. continue
    23. Types (the Basics)
    24. Types (Numbers in Detail)
    25. char
    26. Escape Characters
    27. if as an Expression
  4. Functions, Arrays, and Slices
    1. const
    2. Shadowing
    3. Underscore Variables
    4. Tuples
    5. {:?} and the Debug Format
    6. Simple Functions
    7. Function Parameters
    8. Function Return Values
    9. Early return
    10. Recursion
    11. Array Basics
    12. Iterating over Arrays
    13. Slices: &[T]
    14. Slices as Parameters
    15. String Slices: &str
  5. Structs, Enums, and Pattern Matching
    1. struct (Named Fields)
    2. Tuple structs and Unit structs
    3. enum (C-style)
    4. match on C-style enums
    5. match as an Expression
    6. Block Expressions
    7. enum with Tuple Variants
    8. enum with struct Variants
    9. Destructuring Tuple Variants with match
    10. Destructuring struct Variants with match
    11. Field Shorthand
    12. Tuple Patterns
    13. Slice Patterns
    14. Nested Pattern Matching
    15. The _ Wildcard
    16. Ignoring Multiple Values with ..
    17. Range Patterns
    18. Multiple Values with |
    19. @ Bindings
    20. match Guards
    21. Destructuring Tuples with let
    22. Destructuring structs with let
    23. Destructuring in for Loops
    24. Destructuring in Function Parameters
    25. if let
    26. while let
    27. let else
    28. Associated Functions
    29. Methods
    30. Capital Self
  6. Ownership and Borrowing
    1. Ownership (the Keychain Analogy)
    2. A Brief Introduction to traits
    3. Moves and Clone
    4. Copy
    5. Borrowing: &
    6. Mutable Borrowing: &mut
    7. The Borrowing Rules
    8. self vs &self vs &mut self
    9. The Stack and the Heap
    10. String
    11. String vs &str
    12. Vec Basics
    13. Vec and Ownership
  7. Generics, Trait Bounds, and Lifetimes
    1. Generic Functions
    2. Generic structs
    3. Generic enums
    4. The Turbofish Syntax
    5. The Placeholder Type _
    6. Type Aliases
    7. Generic impl
    8. Option<T>
    9. Common Option Methods
    10. Result<T, E>
    11. The ? Operator
    12. traits with Multiple Methods and Default Implementations
    13. trait Bounds
    14. use Basics
    15. The Display trait
    16. Multiple trait Bounds and where
    17. The impl Trait Syntax
    18. Multi-parameter traits
    19. From<T> / Into<T>
    20. Drop
    21. Box<T>
    22. Rc<T>
    23. Deref
    24. Cell<T>
    25. RefCell<T>
    26. Lifetime Basics
    27. Lifetime Elision Rules
    28. Lifetimes on Types
    29. Lifetime Bounds
    30. Supertraits
    31. Common derive traits
    32. Associated Types
    33. Cow<'a, B>
  8. Closures and Iterators
    1. Function Pointers
    2. Closures in Action
    3. Implementing Closures by Hand
    4. How Closure Kinds Are Inferred
    5. FnOnce / FnMut / Fn
    6. move Closures
    7. Closure Methods on Option / Result
    8. The Iterator trait
    9. What for Loops Really Are
    10. into_iter / iter_mut / iter
    11. Collecting
    12. Aggregation
    13. Combining and Slicing
    14. Transforming and Filtering
    15. Lazy Evaluation
  9. Cargo, Crates, and the Module System
    1. Cargo and crates.io
    2. mod
    3. File mods
    4. pub Visibility
    5. use
    6. cargo test
    7. pub use
    8. The Orphan Rule
    9. Doc Comments
    10. cargo publish
  10. Appendix I
    1. Number Literal Formats
    2. Short-circuiting of && and ||
    3. break with a Value
    4. Multiline Strings & Raw String Literals
    5. Format Strings in Depth
    6. structs / enums inside fns
    7. struct Update Syntax
    8. ref Patterns and match Ergonomics
    9. panic! / todo! / unimplemented! / unreachable!
    10. let Chains
    11. Rc Cycles and Weak
    12. Fully Qualified Syntax
    13. A Brief Introduction to DSTs
    14. extern crate
  11. Part II
  12. Multithreading
    1. Pointers
    2. thread::spawn
    3. Send / Sync
    4. RefCell under Multithreading
    5. Rc under Multithreading
    6. Arc<T>
    7. Atomic Types
    8. Mutex<T>
    9. RwLock<T>
    10. Poisoning
    11. mpsc
    12. Deadlocks
    13. A Brief Introduction to thread::scope
  13. Advanced Language Features
    1. dyn Trait Basics
    2. dyn Compatibility
    3. const fn
    4. Associated consts
    5. const Generics
    6. Default Parameters
    7. Operator Overloading
    8. Type Conversion with as
    9. enum Discriminants
    10. An Overview of Attributes
    11. The cfg! Macro
    12. macro_rules!
    13. Proc Macros
    14. unsafe
    15. static Variables
    16. LazyLock
    17. extern Blocks
    18. union
    19. The Never Type !
  14. Advanced Standard Library Topics
    1. AsRef<T> / AsMut<T>
    2. Ordering and Sorting
    3. HashMap<K, V>
    4. HashSet<T>
    5. A Brief Tour of Other Collections
    6. std::env / std::process
    7. std::path
    8. String Methods
    9. I/O: stdin and File Access
    10. The Error trait
    11. A Brief Introduction to thiserror / anyhow
    12. catch_unwind
  15. Async
    1. Your First async Program
    2. Why We Need async
    3. async fn Returns a Future
    4. async as an Effect
    5. async Blocks
    6. The Future trait and the Most Bare-bones Executor
    7. Writing a Delay Future by Hand
    8. Waiting for Delay with .await
    9. Writing join by Hand
    10. Waking the Executor with Threads and Wakers
    11. spawn and the Ready Queue
    12. spawn and JoinHandle
    13. mio
    14. Writing a Reactor by Hand
    15. The State Machine behind async fn
    16. Self-referential Futures
    17. Why poll Needs Pin
    18. Unpin
    19. pin!
    20. async Recursion
    21. Back to Tokio
    22. spawn_blocking
    23. join!
    24. Semaphore and Backpressure
    25. mpsc
    26. oneshot, watch, and broadcast
    27. AsyncRead and AsyncWrite
    28. select!
    29. async Mutex, RwLock, and Notify
    30. Stream
    31. JoinSet and FuturesUnordered
    32. Graceful Shutdown
    33. Testing async Code
    34. Runtimes Other Than Tokio
  16. Appendix II
    1. 'a: 'b
    2. HRTB
    3. Variance
    4. PhantomData / PhantomPinned
    5. GAT
    6. async Closures
    7. use Bounds