Rust Mastery Notes
This is my learn-by-doing knowledge base — the distilled lessons from each
Rust concept I drill in rust-scratch.
For every concept I finish a ladder of 7–9 problems (foundations → mechanics →
footguns → real-world patterns → a build-it-from-scratch capstone), living in
src/bin/<concept>.rs. Once a ladder is done, I write the lasting takeaways here —
the mental model, the signatures worth memorizing, the footguns I hit, and the
“explain it back” prompts that prove I actually own it.
The code is the gym. This is the notebook.
How to read a note
Each concept page follows the same shape:
| Section | What’s in it |
|---|---|
| TL;DR | The one-paragraph mental model. |
| Why it exists | The problem this concept solves. |
| The ladder | The 7–9 rungs I worked, what each one taught. |
| Signatures to know | The std types/bounds worth memorizing. |
| Footguns | The traps I hit (or that the ladder deliberately set). |
| Explain it back | Questions I should be able to answer cold. |
Completed concepts
| Concept | Note | Source ladder |
|---|---|---|
| Modules & visibility | ✅ note | src/bin/modules.rs |
Cargo features & cfg | ✅ note | src/bin/features_cfg.rs |
| Testing | ✅ note | src/bin/testing.rs + practice/testing_lab/ |
Cow | ✅ note | src/bin/cow.rs |
Box & the heap | ✅ note | src/bin/box_heap.rs |
Rc / Arc | ✅ note | src/bin/rc_arc.rs |
Cell / RefCell | ✅ note | src/bin/cell_refcell.rs |
Rc<RefCell<T>> patterns | ✅ note | src/bin/rc_refcell.rs |
| Conversion traits | ✅ note | src/bin/conversions.rs |
| Lifetimes in depth | ✅ note | src/bin/lifetimes_depth.rs |
HRTB — for<'a> | ✅ note | src/bin/hrtb.rs |
Borrow / ToOwned | ✅ note | src/bin/borrow_toowned.rs |
Drop & ordering | ✅ note | src/bin/drop_ordering.rs |
| Associated types vs generic params | ✅ note | src/bin/assoc_vs_generic.rs |
Generic bounds & where clauses | ✅ note | src/bin/generic_bounds.rs |
| Blanket impls & coherence | ✅ note | src/bin/blanket_coherence.rs |
| Static vs dynamic dispatch | ✅ note | src/bin/dispatch.rs |
Closures & Fn/FnMut/FnOnce | ✅ note | src/bin/closures.rs |
impl Trait & RPIT | ✅ note | src/bin/impl_trait.rs |
| Marker & auto traits | ✅ note | src/bin/marker_auto_traits.rs |
| Error handling architecture | ✅ note | src/bin/error_arch.rs |
| Custom error types | ✅ note | src/bin/custom_errors.rs |
| Builder pattern | ✅ note | src/bin/builder.rs |
| The typestate pattern | ✅ note | src/bin/typestate.rs |
| Newtype & zero-cost wrappers | ✅ note | src/bin/newtype.rs |
| API evolution & semver | ✅ note | src/bin/semver.rs |
| Threads & scoped threads | ✅ note | src/bin/threads.rs |
Send & Sync deeply | ✅ note | src/bin/send_sync.rs |
Mutex / RwLock | ✅ note | src/bin/mutex_rwlock.rs |
| Channels | ✅ note | src/bin/channels.rs |
Data parallelism with rayon | ✅ note | src/bin/rayon_parallel.rs |
| Shared state vs message passing | ✅ note | src/bin/concurrency_models.rs |
| Collections deep-dive | ✅ note | src/bin/collections.rs |
| Strings & text | ✅ note | src/bin/strings_text.rs |
| Iterators end-to-end | ✅ note | src/bin/iterators.rs |
New notes get added under Concepts as each ladder is finished — see Adding a new note.