A struct says 'all of these at once.' An enum says 'exactly one of these.' That flip — from AND to OR — unlocks a way of modeling data that's central to idiomatic Rust.
Variants, with or without data
An enum lists named variants. A value of the enum is one variant at a time. The trick that makes Rust enums powerful: each variant can carry its own data, of its own shape. One variant can be empty, another can hold a tuple, another a struct-like set of fields — all under one type.
Why this is called a sum type
A struct is a 'product type' — its set of possible values is the product of its fields' possibilities. An enum is a 'sum type' — its possible values are the sum of its variants. This isn't academic: it's the tool for modeling a value that is genuinely one-of-several, like a message that's either Quit, or a Move with coordinates, or Text with a string.
Enums get methods too
Just like structs, enums can have impl blocks with methods. A method on an enum typically starts with a match self to do different things per variant — which is exactly what the next lessons build toward.