---
title: "Chapter 11: Enums and Pattern Matching"
description: "The 8 lessons of chapter 11: Enums and Pattern Matching, in teaching order."
url: "https://learnrust.net/chapter-11/"
last_updated: "2026-06-13"
---

# Chapter 11: Enums and Pattern Matching

- [11.1 Enums](https://learnrust.net/chapter-11/enums.md): An enum is a type whose value is exactly one of a fixed set of named variants; when an enum beats a bool, and why match pairs so naturally with enums.
- [11.2 Enums with data](https://learnrust.net/chapter-11/enums-with-data.md): Rust enum variants can carry values of their own, making an enum a value that is one of several shapes; the lightbulb feature that makes enums a headline of the language.
- [11.3 Option and the end of null](https://learnrust.net/chapter-11/option.md): Option<T> is Rust's answer to the billion-dollar null mistake: absence is a value the compiler forces you to handle, and unwrap/expect are finally explained in full.
- [11.4 match in depth](https://learnrust.net/chapter-11/match-in-depth.md): The full power of match: binding patterns, multiple patterns, ranges, match guards, and the @ binding operator, plus the catch-all patterns _ and a name.
- [11.5 Destructuring](https://learnrust.net/chapter-11/destructuring.md): Patterns aren't only for match: destructuring pulls apart structs, tuples, and enums, including in let bindings and function parameters, with nesting.
- [11.6 if let, while let, and let else](https://learnrust.net/chapter-11/if-let-while-let-let-else.md): Three lighter alternatives to match for when you only care about one pattern: if let for a single case, while let for looping, and let else for early exit.
- [11.7 Methods on enums](https://learnrust.net/chapter-11/methods-on-enums.md): impl works on enums just like structs; the worked example is a state machine, where each method matches on self to decide behavior per variant.
- [11.x Chapter 11 summary and quiz](https://learnrust.net/chapter-11/chapter-11-summary-and-quiz.md): Review of enums, data-carrying variants, Option, match in depth, destructuring, the if let family, and enum methods, with a chapter quiz and capstone.

## Sitemap

See the full [sitemap](https://learnrust.net/sitemap.md) for all pages.
