← Full-stack Dev

Rust: Zero to Depth

A fixed-syllabus Rust series: ownership and borrowing, lifetimes and the type system, Cargo engineering, concurrency and async, unsafe and macros, performance work, and ecosystem choices — from the first program to thinking like a Rustacean.

14 postsIn reading order
Part 1

Why Rust, Why 2026: The Map Before the First Compile

Part 1 of the Rust: Zero to Depth series: why Rust won the systems decade, where it actually runs in 2026, the ownership idea in one paragraph, the honest learning curve, and the toolchain you need before writing a line.

RustSystems ProgrammingOwnershipCargoLearning
Part 2

Ownership and Borrowing: The Three Rules That Are the Language

Part 2 of the Rust: Zero to Depth series: move semantics and why assignment isn't a copy, the readers-XOR-writer rule, non-lexical lifetimes, what the 2024 edition and Polonius change, and the patterns that end the fight with the borrow checker.

RustOwnershipBorrowingMemory SafetyBorrow Checker
Part 3

Lifetimes: Annotations That Describe, Not Command

Part 3 of the Rust: Zero to Depth series: what a lifetime actually is, the three elision rules that write them for you, the two places you must annotate, the two meanings of 'static, and the temporary-scope fixes in the 2024 edition.

RustLifetimesBorrow CheckerElisionRust 2024
Part 4

Enums Are State Machines: Pattern Matching and the Type System's First Payoff

Part 4 of the Rust: Zero to Depth series: enums that carry data and make illegal states unrepresentable, match and its exhaustiveness check turning refactors into a guided walk, Option as the funeral of null, and how Result with the ? operator flattens error handling from a pyramid into a straight line.

RustEnumsPattern MatchingError HandlingResult
Part 5

Traits: Contracts for Shared Behavior, Not Family Trees

Part 5 of the Rust: Zero to Depth series: what a trait is, why the orphan rule protects you, how a world without inheritance organizes code through composition, what one line of derive buys you, and the six standard traits you'll deal with every day — Debug, Display, From, Clone, Drop, and Iterator.

RustTraitsCompositionStandard LibraryIdioms
Part 6

Smart Pointers: Behind Every “No,” a Clearly Priced Door

Part 6 of the Rust: Zero to Depth series: why Box is not an escape hatch but the entry ticket for recursive types, how Rc shares ownership by counting, how RefCell moves borrow checking to runtime, what each half of the classic Rc<RefCell<T>> combo solves, and the price of every trade — plus their multi-threaded relatives.

RustSmart PointersBoxRcRefCellInterior Mutability
Part 7

Generics and impl Trait: One Contract, Two Directions

Part 7 of the Rust: Zero to Depth series: the full grammar of generics and trait bounds, why monomorphization is zero-cost, the asymmetry of impl Trait in argument vs return position, the static-vs-dyn dispatch trade-off, and the return-position lifetime capture the 2024 edition fixed with + use<...>.

RustGenericsimpl TraitdynMonomorphizationRust 2024
Part 8

Cargo and the Module System: Packing the Type System into a Maintainable Project

Part 8 of the Rust: Zero to Depth series: the real relationship between packages and crates, how mod declarations wire the module tree, the visibility ladder and E0603, organizing with workspaces and their shared build cache, the additive rule of feature flags, and the cargo commands you use every workday.

RustCargoModulesWorkspaceFeature FlagsTooling
Part 9

Fearless Concurrency: How Data Races Become Compile Errors

Part 9 of the Rust: Zero to Depth series: how the Send and Sync marker traits make thread-safety a type-level fact, how scoped threads legally borrow stack data, the exact correspondence between Arc<Mutex<T>> and Part 6's Rc<RefCell<T>>, and the ownership philosophy behind channels — share memory by communicating.

RustConcurrencySend SyncArc MutexChannelsFearless Concurrency
Part 10

Async/Await: An Honest Teardown of State Machines, Poll, and Executors

Part 10 of the Rust: Zero to Depth series: the state machine an async fn compiles into, why a Future does nothing until polled, a hand-written Future and a toy executor, the waker's role, which bottleneck of the thread model tokio solves, and the selection rule — threads for CPU-bound work, async for I/O-bound work.

RustAsyncAwaitFutureTokioExecutors
Part 11

unsafe: Five Powers, One Door, and a Counterintuitive Fact

Part 11 of the Rust: Zero to Depth series: the counterintuitive fact that unsafe does not disable the borrow checker, the five exact superpowers and their uses, the contract difference between raw pointers and references, how to draw a safe-abstraction boundary with SAFETY comments, and why seasoned Rustaceans write less and less unsafe.

RustunsafeFFISafe AbstractionRaw Pointers
Part 12

Macros: Code That Writes Code, and When to Resist Writing It

Part 12 of the Rust: Zero to Depth series: why println! can only be a macro, the pattern-matcher nature of macro_rules! declarative macros, how hygiene quarantines macro-local variables, the $crate path convention, the three procedural-macro brothers (derive / attribute / function-like) with a hand-built mini derive, and the judgment ladder for when not to use a macro.

RustMacrosmacro_rulesProcedural MacrosMetaprogramming
Part 13

Performance Engineering: Measure First, Then Read the Assembly Yourself

Part 13 of the Rust: Zero to Depth series: the only loop that matters in performance work, the division of labor between micro-benchmarks and profilers, allocation as the invisible tax, measured Vec growth numbers and with_capacity, how to verify the zero-cost promise of iterators with your own eyes, and five rules for the hot path.

RustPerformanceProfilingBenchmarkingZero-Cost Abstractions
Part 14

Ecosystem Selection and the Voyage: From cargo new to Rustacean

Part 14 of the Rust: Zero to Depth series (the finale): the de facto standards of the starter stack, the thiserror/anyhow dividing line proven in code, a five-signal due-diligence method for reading a crate, a full look back across fourteen parts, and the road ahead for a Rustacean.

RustEcosystemCratesthiserroranyhowCareer
guest@swangnice:~$