pub struct Variant {
pub name: &'static str,
pub index: usize,
pub discriminant: Option<i64>,
}Expand description
An enum variant’s name, declaration index and discriminant.
discriminant is the compiler-assigned tag value, recorded only for fieldless enums where it can be read on stable
via an as cast. Data-carrying variants record None; their index still pins declaration order, which is what a
#[repr(C, uN)] tag is derived from.
Fields§
§name: &'static str§index: usize§discriminant: Option<i64>Trait Implementations§
impl Copy for Variant
impl Eq for Variant
impl StructuralPartialEq for Variant
Auto Trait Implementations§
impl Freeze for Variant
impl RefUnwindSafe for Variant
impl Send for Variant
impl Sync for Variant
impl Unpin for Variant
impl UnsafeUnpin for Variant
impl UnwindSafe for Variant
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