Struct stable_mir::ty::VariantIdx
source · pub struct VariantIdx(usize);
Expand description
The source-order index of a variant in a type.
For example, in the following types,
ⓘ
enum Demo1 {
Variant0 { a: bool, b: i32 },
Variant1 { c: u8, d: u64 },
}
struct Demo2 { e: u8, f: u16, g: u8 }
a
is in the variant with the VariantIdx
of 0
,
c
is in the variant with the VariantIdx
of 1
, and
g
is in the variant with the VariantIdx
of 0
.
Tuple Fields§
§0: usize
Trait Implementations§
source§impl Clone for VariantIdx
impl Clone for VariantIdx
source§fn clone(&self) -> VariantIdx
fn clone(&self) -> VariantIdx
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for VariantIdx
impl Debug for VariantIdx
source§impl Hash for VariantIdx
impl Hash for VariantIdx
source§impl IndexedVal for VariantIdx
impl IndexedVal for VariantIdx
source§impl PartialEq for VariantIdx
impl PartialEq for VariantIdx
source§fn eq(&self, other: &VariantIdx) -> bool
fn eq(&self, other: &VariantIdx) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for VariantIdx
impl Eq for VariantIdx
impl StructuralPartialEq for VariantIdx
Auto Trait Implementations§
impl Freeze for VariantIdx
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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: 8 bytes