Rust Lifetimes Contents Cheatsheet
A Craftsman's Guide

Rust
Lifetimes

Understanding what 'a actually means — with the memory-management story that makes it make sense.

An hourglass whose falling sand forms the Rust lifetime tick-mark 'a, on a craftsman's workbench
Cover art needed

A refined flat-vector book cover illustration: on a warm cream paper background, a large brass hourglass sits on a craftsman's wooden workbench beside woodworking tools; the sand falling inside the hourglass streams into the shape of a bold apostrophe-and-letter mark ('a) in oxide-rust orange. Deep teal and burnt-orange accent palette, generous negative space, subtle paper-grain texture, no text or lettering other than the 'a formed by the sand. Target size ~1200×800px, 3:2 landscape; compose with the hourglass centred and safe margins — the art is letterboxed into a 3:2 box, so keep nothing important near the edges.

Generate this with your image agent, then drop the file here.

Time, made visible — which is all a lifetime is.

Contents

  1. The Trouble with Lifetimes why it's hard, and the workshop model
  2. Stack, Heap, and the Shape of Memory where data lives; who cleans up
  3. Ownership, Moves, and Drop one owner; the brace is the destructor
  4. Borrowing: References Without Ownership shared XOR mutable; loans end before owners
  5. What a Lifetime Actually Is regions, 'a notation, describe-don't-extend
  6. Lifetimes in Function Signatures the longest() example, solved properly
  7. Elision: The Rules You've Been Using three mechanical rules; de-elide to debug
  8. Lifetimes in Structs and Methods types that borrow are borrows
  9. 'static: The Most Misunderstood Lifetime forever-references vs. self-contained values
  10. The Borrow Checker's Mind: NLL and Beyond liveness, Polonius, HRTBs, 2024 capture rules
  11. Cheatsheet the 30-second version, printable
How to Read This Book

Chapters 2–4 are the memory-management foundation; 5–8 are the craft of lifetimes themselves; 9–10 are mastery. Use and to turn pages, to return here. Each chapter ends with challenges — the Rust Playground is your workbench.

⌂ Library