1.1 Introducing Rust
Rust is like a critical spouse
1.2 Comments
1.3 Primitive types: Integers, characters, and strings
1.4 Type inference
1.5 Floats
1.6 “Hello, World!” and printing
1.7 Declaring variables and code blocks
1.9 Smallest and largest numbers
1.11 Shadowing
2 Memory, variables, and ownership
2.1 The stack, the heap, pointers, and references
2.2 Strings
2.3 const and static
Situation 1: Only one mutable reference
Situation 2: Only immutable references
Situation 3: The problem situation
2.6 Shadowing again
2.7 Giving references to functions
2.8 Copy types
2.10 More about printing
3.1 Collection types
3.2 Control flow
4.1 A quick overview of structs and enums
Implementing structs and enums
4.2 Destructuring
4.3 References and the dot operator
5 Generics, option, and result
5.1 Generics
Some other ways to do pattern matching
6 More collections, more error handling
6.2 The ? operator
6.3 When panic and unwrap are good
7 Traits: Making different types do the same thing
All you need are the method signatures
Traits are like qualifications
7.2 The From trait
7.3 The orphan rule
7.4 Getting around the orphan rule with newtypes
7.5 Taking a String and a &str in a function
8.1 Chaining methods
8.2 Iterators
8.3 Closures and closures inside iterators
9 Iterators and closures again!
9.1 Helpful methods for closures and iterators
Some more iterator and related methods
Checking and finding items inside iterators
Cycling, zipping, folding, and more
9.2 The dbg! macro and .inspect
10 Lifetimes and interior mutability
10.1 Types of &str
10.2 Lifetime annotations
10.3 Interior mutability
11 Multiple threads and a lot more
11.1 Importing and renaming inside a function
11.2 The todo! macro
11.3 Type aliases
11.4 Cow
11.5 Rc
Avoiding lifetime annotations with Rc
11.6 Multiple threads
Using JoinHandles to wait for threads to finish
12 More on closures, generics, and threads
The relationship between FnOnce, FnMut, and Fn
12.2 impl Trait
Regular generics compared to impl Trait
Returning closures with impl Trait
12.3 Arc
12.4 Scoped threads
12.5 Channels
13.1 Reading Rust documentation
13.2 Box
Using a Box to handle multiple error types
Downcasting to a concrete type
14 Testing and building your code from tests
14.1 Crates and modules
More on how the pub keyword works
14.2 Testing
Just add #[test], and now it’s a test
Building a calculator: Starting with the tests
Putting the calculator together
15 Default, the builder pattern, and Deref
15.1 Implementing Default
15.2 The builder pattern
Adding a final check to the builder pattern
Making the builder pattern more rigorous
15.3 Deref and DerefMut
16 Const, “unsafe” Rust, and external crates
16.1 Const generics
16.2 Const functions
16.3 Mutable statics
16.4 Unsafe Rust
Using static mut in unsafe Rust
Rust’s most famous unsafe method
16.5 Introducing external crates
17.1 serde
17.2 Time in the standard library
17.3 chrono
Checking the code inside external crates
17.4 Rayon
17.5 Anyhow and thiserror
17.6 Blanket trait implementations
17.7 lazy_static and once_cell
Lazy static: Lazily evaluated statics
OnceCell: A cell to only write to once
18.1 Cargo
Using Cargo and what Rust does while it compiles
Accessing command-line arguments
Accessing environment variables
18.3 Using files
Using OpenOptions to work with files
18.4 cargo doc
19.1 The reqwest crate
19.2 Feature flags
19.3 Async Rust
Checking whether a Future is ready
Some other details about async Rust
20 A tour of the standard library
20.1 Arrays
Destructuring and mapping arrays
20.2 char
20.3 Integers
The Add trait and other similar traits
20.4 Floats
20.5 Associated items and associated constants
20.6 bool
20.7 Vec
20.8 String
20.9 OsString and CString
21.1 std::mem
21.2 Setting panic hooks
21.3 Viewing backtraces
21.4 The standard library prelude
21.5 Other macros
column!, line!, file!, and module_path!
22.1 Why macros exist
22.2 Writing basic macros
22.3 Reading macros from the standard library
22.4 Using macros to keep your code clean
23 Unfinished projects: Projects for you to finish
23.1 Setup for the last two chapters
23.2 Typing tutor
Further development and cleanup
23.3 Wikipedia article summary searcher
Further development and cleanup
23.4 Terminal stopwatch and clock
Further development and cleanup
24 Unfinished projects, continued
24.1 Web server word-guessing game
Further development and cleanup
24.2 Laser pointer
Further development and cleanup
24.3 Directory and file navigator
Further development and cleanup