Enums list variants, each optionally holding data of different shapes. This makes illegal states unrepresentable — a common Rust design habit. `match` on an enum must be exhaustive, so adding a variant surfaces every place needing an update.
← Rust theorytheory 0/50 · 0%
Types · easy
12. Enums
Sum types that carry data.
Check your understanding
1. Can enum variants hold data?
2. Match on an enum must be…