Rust
roadmap.sh: https://roadmap.sh/rust
Suggested path through the Rust nodes. Each node links to its lesson when written.
Nodes
Introduction
- What is Rust
- Why Rust (Safety / Performance)
- Installing Rust (rustup)
rustc& the Toolchain- Hello World
- Cargo Basics
- Rust Editions
Language Basics
- Variables & Mutability
- Constants & Shadowing
- Scalar Types
- Compound Types (Tuples, Arrays)
- Functions
- Comments & Doc Comments
- Control Flow (
if/loop/while/for) - Statements vs Expressions
Ownership & Borrowing
- Ownership Rules
- Move Semantics
- Clone vs Copy
- References & Borrowing
- Mutable References
- Slices
- The Borrow Checker
- Lifetimes
- Lifetime Elision
Compound & Custom Types
- Structs
- Tuple & Unit Structs
- Enums
- Pattern Matching (
match) if let/let else/while let- Methods & Associated Functions
implBlocks
Error Handling
Option<T>Result<T, E>- The
?Operator panic!& Unrecoverable Errors- Custom Error Types
thiserror/anyhow
Generics & Traits
- Generic Functions & Types
- Traits
- Trait Bounds
- Default Implementations
- Trait Objects & Dynamic Dispatch
- Associated Types
- Operator Overloading
- Derive Macros
- Marker Traits (Send / Sync / Sized)
Collections & Strings
Vec<T>Stringvs&strHashMap/BTreeMapHashSet/BTreeSetVecDeque- Iterators
- Iterator Adapters (map / filter / collect)
- Closures
Smart Pointers
Box<T>Rc<T>/Arc<T>RefCell<T>& Interior MutabilityCell<T>Deref&Drop- Reference Cycles &
Weak<T>
Concurrency
- Threads (
std::thread) moveClosures- Message Passing (channels)
- Shared State (
Mutex/RwLock) Send&SyncRevisited- Atomics
- Async / Await
- Futures & Executors (tokio / async-std)
Modules & Crates
- Modules & Paths
pub& VisibilityuseDeclarations- Packages vs Crates
- Workspaces
- Crates.io & Dependencies
- Semantic Versioning
Advanced
- Unsafe Rust
- Raw Pointers
- FFI (calling C)
- Declarative Macros (
macro_rules!) - Procedural Macros
- Advanced Traits (Supertraits, Newtype)
constGenerics- Zero-Cost Abstractions
Tooling & Ecosystem
- Cargo (build / run / check)
rustfmt- Clippy
cargo test& Testing- Documentation Tests
- Benchmarking
cargo doc- Debugging (gdb / lldb)
- Publishing a Crate
Resources
See resources.md.
Project ideas
- Extend
playgrounds/rust/with a newcli-grepmember crate (cargo new --bin cli-grep) that reads a file, filters lines by a pattern, and exercisesResult, the?operator, and iterator adapters. - Add a
threadpoolcrate to the workspace that builds a fixed-size worker pool withstd::thread+ channels — the Rust mirror of the Goworker-poolplayground — to internalizeSend/SyncandArc<Mutex<…>>. - Generalize the existing
playgrounds/rust/binary-searchinto a genericfn binary_search<T: Ord>(…)with trait bounds and a full set of#[test]cases plus a doc test.