A comprehensive learning roadmap for Rust, from basic syntax and ownership fundamentals to advanced concurrency, macros, and unsafe code. Designed for learners at any level who want to master Rust's unique approach to systems programming with safety and performance.
§ SYLLABUS
- 01Rust Toolchain & Cargo
Set up your Rust development environment with rustup, understand the compiler, and learn how Cargo manages projects, dependencies, and builds.
- 02Variables, Mutability & Scalar Types
Understand let bindings, mutability with mut, shadowing, and Rust's scalar types including integers, floats, booleans, and characters.
- 03Functions & Control Flow
Write functions with explicit type signatures, use if/else expressions, loop constructs (loop, while, for), and understand that most constructs in Rust are expressions.
- 04Compound Types: Tuples, Arrays & Slices
Work with fixed-size compound data using tuples and arrays, and understand slices as dynamically-sized views into contiguous memory.
- 01Ownership & Move Semantics
Understand Rust's ownership model — each value has one owner, ownership can be moved, and values are dropped when the owner goes out of scope.
- 02Borrowing & References
Learn how to borrow values with shared (&T) and mutable (&mut T) references, and understand the borrowing rules that prevent data races at compile time.
- 03Lifetimes
Understand lifetime annotations, how the compiler tracks reference validity, lifetime elision rules, and how to resolve common lifetime errors.
- 04Smart Pointers: Box, Rc, Arc, RefCell
Use heap allocation with Box, shared ownership with Rc/Arc, and interior mutability with RefCell/Mutex to handle patterns that simple references cannot express.
- 01Structs & Methods
Define data structures with structs, implement methods and associated functions with impl blocks, and understand the difference between named, tuple, and unit structs.
- 02Enums, Option & Result
Model variants with enums, use the built-in Option<T> and Result<T, E> types to handle absence and errors, and avoid null-pointer bugs entirely.
- 03Pattern Matching & Destructuring
Use match expressions, if let, while let, and destructuring to elegantly handle enums, structs, tuples, and nested data.
- 01Traits & Trait Bounds
Define shared behavior with traits, implement them for your types, and use trait bounds to write generic code that requires specific capabilities.
- 02Generics & Monomorphization
Write type-parameterized functions, structs, and enums, and understand how Rust's monomorphization gives you zero-cost abstractions.
- 03Trait Objects & Dynamic Dispatch
Use dyn Trait for runtime polymorphism, understand object safety rules, and know when to choose dynamic dispatch over generics.
- 04Common Standard Traits
Implement and use essential traits like Display, Debug, Clone, Copy, From, Into, Iterator, and understand derive macros.
- 01The ? Operator & Error Propagation
Use the ? operator to propagate errors concisely, chain fallible operations, and understand how From conversions enable ergonomic error handling.
- 02Custom Error Types & thiserror/anyhow
Design your own error enums, use the thiserror crate for boilerplate-free error definitions, and anyhow for flexible application-level error handling.
- 03Panic, Unwinding & Abort
Understand when Rust panics, the difference between unwinding and aborting, when to use unwrap/expect, and how to write panic-safe code.
- 01Standard Collections: Vec, HashMap, HashSet
Use Rust's core collections for dynamic arrays, key-value maps, and unique sets, understanding their ownership and borrowing implications.
- 02Strings: String vs &str
Understand the difference between owned Strings and borrowed &str slices, UTF-8 encoding, and common string manipulation patterns.
- 03Iterators & Closures
Use Rust's powerful iterator combinators (map, filter, fold, collect) with closures, and understand lazy evaluation and the Iterator trait.
- 01Threads & Message Passing
Spawn OS threads, communicate safely with channels (mpsc), and understand how Rust's type system prevents data races at compile time.
- 02Shared State: Mutex, RwLock & Atomics
Safely share mutable state between threads using Mutex and RwLock, understand poisoning, and use atomic types for lock-free operations.
- 03Send & Sync Traits
Understand the Send and Sync marker traits that encode thread-safety guarantees in the type system, and why they make fearless concurrency possible.
- 04Async/Await & Futures
Write non-blocking code with async/await syntax, understand the Future trait, pinning, and how async runtimes like Tokio execute tasks.
- 01Macros: Declarative & Procedural
Write declarative macros with macro_rules! for code generation, and understand procedural macros including derive macros for metaprogramming.
- 02Unsafe Rust
Understand when and how to use unsafe blocks to dereference raw pointers, call FFI functions, and implement unsafe traits, while maintaining safety invariants.
- 03FFI & Interop with C
Call C libraries from Rust and expose Rust functions to C using extern, understand ABI compatibility, and use bindgen for automatic bindings.
- 01Testing & Benchmarking
Write unit tests, integration tests, and doc tests with Rust's built-in test framework, use test organization conventions, and benchmark performance.
- 02Modules, Crates & Workspaces
Organize code with Rust's module system, publish crates, manage multi-crate projects with workspaces, and understand visibility rules.
- 03Serialization with Serde
Use the Serde framework to serialize and deserialize data to JSON, TOML, and other formats with derive macros and custom implementations.