What the difference between enum and struct?

The struct define:
pub struct Struct { pub struct_type: StructType, pub generics: Generics, pub fields: Vec<Item>, pub fields_stripped: bool, }
The enum define:
pub struct Enum {
pub variants: Vec,
pub generics: Generics,
pub variants_stripped: bool,
}
they also have the same trait.
so,I want to know what's the difference between them?

You might find Structs and Enums helpful here.

1 Like