🦀 Learn Rust — From Zero to Pro
A comprehensive, edge-case-covering, idiomatic Rust curriculum. Each document is self-contained and covers its concept deeply enough that a careful reader can go from beginner to pro Rust developer.
- Read sequentially for a structured path (01 → 35).
- Jump to a chapter as a reference when you hit a concept in the wild.
- Run the exercises in chapter 35 after every few chapters.
- Read the source of std and
tokio alongside.
- A working Rust toolchain (
rustup). - A code editor (VS Code +
rust-analyzer recommended). - Comfort with at least one other programming language.
| # | Topic | Why It Matters |
|---|
| 01 | Introduction & Setup | Toolchain, cargo, project layout. |
| 02 | Hello World & Cargo Deep Dive | Cargo.toml, dependencies, workspaces. |
| 03 | Variables & Mutability | Immutability, shadowing, const, static. |
| 04 | Data Types | Integers, floats, char, tuples, arrays, casts. |
| 05 | Functions | Statements vs expressions, divergence, impl. |
| 06 | Control Flow | if/while/for/loop/match as expressions. |
| # | Topic | Why It Matters |
|---|
| 11 | Structs | Named/tuple/unit, impl, derives. |
| 12 | Enums | ADTs, Option, Result, niche optimization. |
| 13 | Pattern Matching | All pattern forms, binding modes, guards. |
| 14 | Collections | Vec, String, HashMap, and friends. |
| # | Topic | Why It Matters |
|---|
| 24 | Macros | macro_rules!, proc-macros, cargo expand. |
| 25 | Unsafe Rust | Raw pointers, FFI, soundness, Miri. |
| 26 | FFI | Calling C, calling Rust from C, bindgen/cxx. |
| # | Topic | Why It Matters |
|---|
| 27 | Attributes & Conditional Compilation | #[cfg], #[derive], lints, #[non_exhaustive]. |
| 28 | Cargo Features & Release Engineering | Features, profiles, CI, publishing. |
| 29 | Advanced Type System | Variance, HRTBs, GATs, const generics. |
| 30 | Design Patterns & Idiomatic Rust | Builder, typestate, newtype, RAII. |
| 31 | Performance, Profiling & Optimization | criterion, flamegraph, allocation pitfalls. |
| 32 | Documentation | rustdoc, doc tests, intra-doc links. |
| 33 | Ecosystem Tour | Curated map of crates for every domain. |
| 34 | Common Pitfalls & Idiomatic Fixes | 40+ traps and their fixes. |
| 35 | Exercises & Project Ideas | From beginner to pro. |
- Read 01–14 in order.
- Skip to 21 (Testing) and write tests for everything you've built.
- Skim 15–18 and 22–23, then come back to the harder parts.
- Do exercises 1–5 in chapter 35.
Read 07–10 carefully (ownership is the new mental model). Skim 04 (data types) — you'll find surprises (char is 4 bytes). Read 25 (Unsafe) to understand what Rust adds over C. Then 22 and 23.
Ownership will be new. Read 03–10 slowly. Don't skip 18 (Error Handling) — Result/? is the culture. Don't reach for clone reflexively.
Skim 01–14. Read 16, 18, 22, 23, 27, 28 closely. Use 30, 34 as references. Skim 33 for the crate landscape. Then read 35 and pick a project.
rustup component add rustfmt clippy rust-src rust-analyzer
cargo install cargo-expand cargo-nextest cargo-deny cargo-audit \
cargo-flamegraph cargo-bloat cargo-machete cargo-release \
samply cargo-watch mdbook
These notes are yours to use, share, and modify.
🦀