pub type Variants = Variants<RustcFieldIdx, RustcEnumVariantIdx>;Aliased Type§
pub enum Variants {
Empty,
Single {
index: RustcEnumVariantIdx,
},
Multiple {
tag: Scalar,
tag_encoding: TagEncoding<RustcEnumVariantIdx>,
tag_field: RustcFieldIdx,
variants: IndexVec<RustcEnumVariantIdx, LayoutData<RustcFieldIdx, RustcEnumVariantIdx>>,
},
}Variants§
Empty
A type with no valid variants. Must be uninhabited.
Single
Single enum variants, structs/tuples, unions, and all non-ADTs.
Fields
§
index: RustcEnumVariantIdxAlways 0 for types that cannot have multiple variants.
Multiple
Enum-likes with more than one variant: each variant comes with a discriminant (usually the same as the variant index but the user can assign explicit discriminant values). That discriminant is encoded as a tag on the machine. The layout of each variant is a struct, and they all have space reserved for the tag. For enums, the tag is the sole field of the layout.
Fields
§
tag: Scalar§
tag_encoding: TagEncoding<RustcEnumVariantIdx>§
tag_field: RustcFieldIdx§
variants: IndexVec<RustcEnumVariantIdx, LayoutData<RustcFieldIdx, RustcEnumVariantIdx>>