Article · 1 min read

🦀 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.

How to Use This Course

  1. Read sequentially for a structured path (01 → 35).
  2. Jump to a chapter as a reference when you hit a concept in the wild.
  3. Run the exercises in chapter 35 after every few chapters.
  4. Read the source of std and tokio alongside.

Prerequisites

  • A working Rust toolchain (rustup).
  • A code editor (VS Code + rust-analyzer recommended).
  • Comfort with at least one other programming language.

Curriculum

Part I — Foundations

#TopicWhy It Matters
01Introduction & SetupToolchain, cargo, project layout.
02Hello World & Cargo Deep DiveCargo.toml, dependencies, workspaces.
03Variables & MutabilityImmutability, shadowing, const, static.
04Data TypesIntegers, floats, char, tuples, arrays, casts.
05FunctionsStatements vs expressions, divergence, impl.
06Control Flowif/while/for/loop/match as expressions.

Part II — Ownership & Borrowing (The Heart of Rust)

#TopicWhy It Matters
07OwnershipMove semantics, Drop, Copy.
08References & Borrowing&T/&mut T, NLL, borrow rules.
09Slices&[T], &str, fat pointers.
10Lifetimes'a, elision, 'static, variance.

Part III — Modeling Data

#TopicWhy It Matters
11StructsNamed/tuple/unit, impl, derives.
12EnumsADTs, Option, Result, niche optimization.
13Pattern MatchingAll pattern forms, binding modes, guards.
14CollectionsVec, String, HashMap, and friends.

Part IV — Abstraction & Reuse

#TopicWhy It Matters
15Iterators & CombinatorsZero-cost iteration, collect, custom Iterator.
16Traits & GenericsTrait bounds, object safety, impl Trait.
17ClosuresFn/FnMut/FnOnce, capture, move.
18Error HandlingResult/Option, ?, thiserror/anyhow.

Part V — Memory & Organization

#TopicWhy It Matters
19Smart PointersBox/Rc/Arc/RefCell/Mutex/Cow/Pin.
20Modules & CratesVisibility, paths, use, workspaces.
21TestingUnit/integration/doc tests, criterion, fuzzing.

Part VI — Concurrency & Async

#TopicWhy It Matters
22Concurrency & MultithreadingSend/Sync, threads, channels, atomics.
23Async / AwaitFutures, runtimes, select!, streams, spawn_blocking.

Part VII — Metaprogramming

#TopicWhy It Matters
24Macrosmacro_rules!, proc-macros, cargo expand.
25Unsafe RustRaw pointers, FFI, soundness, Miri.
26FFICalling C, calling Rust from C, bindgen/cxx.

Part VIII — Production Engineering

#TopicWhy It Matters
27Attributes & Conditional Compilation#[cfg], #[derive], lints, #[non_exhaustive].
28Cargo Features & Release EngineeringFeatures, profiles, CI, publishing.
29Advanced Type SystemVariance, HRTBs, GATs, const generics.
30Design Patterns & Idiomatic RustBuilder, typestate, newtype, RAII.
31Performance, Profiling & Optimizationcriterion, flamegraph, allocation pitfalls.
32Documentationrustdoc, doc tests, intra-doc links.
33Ecosystem TourCurated map of crates for every domain.
34Common Pitfalls & Idiomatic Fixes40+ traps and their fixes.
35Exercises & Project IdeasFrom beginner to pro.

Learning Path Suggestions

If you're new to systems programming

  1. Read 01–14 in order.
  2. Skip to 21 (Testing) and write tests for everything you've built.
  3. Skim 15–18 and 22–23, then come back to the harder parts.
  4. Do exercises 1–5 in chapter 35.

If you're coming from C/C++

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.

If you're coming from Python/JS/Ruby

Ownership will be new. Read 03–10 slowly. Don't skip 18 (Error Handling) — Result/? is the culture. Don't reach for clone reflexively.

If you're a senior engineer learning Rust for production

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.

Companion Resources

Tooling to Install

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

License

These notes are yours to use, share, and modify.

🦀