Back to library

🦀Rust's Ownership Model

Build a working mental model of Rust's ownership system — from stack vs heap intuition through borrow checker mastery — so you can read and write Rust without fighting the compiler.

Applied14 drops~2-week path · 5–8 min/daytechnology

Phase 1Ownership from Scratch

Stack, heap, and what moving really means

4 drops
  1. Every value lives somewhere — stack or heap

    6 min

    Every value lives somewhere — stack or heap

  2. Assignment doesn't copy — it transfers ownership

    6 min

    Assignment doesn't copy — it transfers ownership

  3. Borrow the book, don't photocopy the library

    7 min

    Borrow the book, don't photocopy the library

  4. When the owner dies, the value dies with it

    7 min

    When the owner dies, the value dies with it

Phase 2Borrow Checker Drills

Fix broken snippets and decode compiler errors

5 drops
  1. Passing a value to a function is a move

    6 min

    Passing a value to a function is a move

  2. Two mutable references and the compiler says no

    7 min

    Two mutable references and the compiler says no

  3. You can't return a reference to a local variable

    6 min

    You can't return a reference to a local variable

  4. Your struct owns its fields — or borrows trouble

    7 min

    Your struct owns its fields — or borrows trouble

  5. Read the error, then read it again — the fix is in there

    6 min

    Read the error, then read it again — the fix is in there

Phase 3Patterns in the Wild

Lifetimes, RAII, and real-world ownership patterns

4 drops
  1. Your function returns a reference — whose data is it borrowing?

    7 min

    Your function returns a reference — whose data is it borrowing?

  2. Your MutexGuard unlocked itself — on purpose

    7 min

    Your MutexGuard unlocked itself — on purpose

  3. When one owner isn't enough — Rc, Arc, and shared ownership

    7 min

    When one owner isn't enough — Rc, Arc, and shared ownership

  4. Clone is explicit effort — Copy is the compiler being generous

    6 min

    Clone is explicit effort — Copy is the compiler being generous

Phase 4Refactor a Linked List

Refactor a linked list past the borrow checker

1 drop
  1. Build a linked list that the borrow checker approves

    8 min

    Build a linked list that the borrow checker approves

Frequently asked questions

Why does Rust move values instead of copying them?
This is covered in the “Rust's Ownership Model” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
What's the difference between &T and &mut T?
This is covered in the “Rust's Ownership Model” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
When should I use Rc or Arc instead of plain ownership?
This is covered in the “Rust's Ownership Model” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
How do lifetimes relate to ownership?
This is covered in the “Rust's Ownership Model” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.
Can I just use clone() everywhere to avoid the borrow checker?
This is covered in the “Rust's Ownership Model” learning path. Start with daily 5-minute micro-lessons that build from fundamentals to hands-on application.