Rust theorytheory 0/50 · 0%
Types · easy

12. Enums

Sum types that carry data.

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.

Check your understanding

  1. 1. Can enum variants hold data?

  2. 2. Match on an enum must be…