An enumerated type defines a fixed size set of possible values. It is
declared using the enum keyword.
Here is an example that defines the card suits:
#[derive(Debug)]
enum Suit {
Club,
Diamond,
Heart,
Spade,
}for x in [Suit::Diamond, Suit::Club, Suit::Heart, Suit::Spade] {
println!("{x:?}");
}Diamond
Club
Heart
Spade
()