Defining enums
An enum lists every shape a value of that type can take. `enum Shape { Circle(f64), Rectangle(f64, f64), Square(f64) }` defines three variants, each carrying its own data.
For deeper background, see the canonical Rust learning roadmap for the broader context behind this section.
The match expression
`match` is Rust's most powerful control flow construct. It compares a value against a series of patterns and runs the arm that matches. The compiler will reject any match that does not cover every variant.
if let and while let
When you only care about one variant, `if let Some(x) = option { ... }` is more concise than a full match. `while let` repeats the pattern until the match fails.
Result and Option
Two of the most common enums in std are `Option<T>` (Some or None) and `Result<T, E>` (Ok or Err). Idiomatic Rust uses these everywhere a value might be missing or a function might fail.