Struct rustc_target::abi::VariantIdx
source · pub struct VariantIdx {
pub(crate) private: u32,
}
Expand description
The source-order index of a variant in a type.
For enums, these are always 0..variant_count
, regardless of any
custom discriminants that may have been defined, and including any
variants that may end up uninhabited due to field types. (Some of the
variants may not be present in a monomorphized ABI Variants
, but
those skipped variants are always counted when determining the index.)
struct
s, tuples
, and unions
s are considered to have a single variant
with variant index zero, aka FIRST_VARIANT
.
Fields§
§private: u32
Auto Trait Implementations§
impl RefUnwindSafe for VariantIdx
impl Send for VariantIdx
impl Sync for VariantIdx
impl Unpin for VariantIdx
impl UnwindSafe for VariantIdx
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 4 bytes