Use a struct to group related data fields together, and use an enum to define a type that can be one of several distinct variants. Structs represent objects with multiple properties, while enums represent a value that must be exactly one of a fixed set of options.
// Use a struct for related data
struct User {
username: String,
active: bool,
}
// Use an enum for distinct states
enum Status {
Active,
Inactive,
Pending,
}