#[non_exhaustive]pub struct EnumDef {
pub name: String,
pub repr: Scalar,
pub variants: Vec<Variant>,
pub other: Option<String>,
pub doc: Option<String>,
}Expand description
An enumeration of named values, with an optional fallback variant for unlisted values.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe type name.
repr: ScalarThe value’s type.
variants: Vec<Variant>The variants, in declaration order.
other: Option<String>The fallback variant, which holds an unlisted value. None means every value is listed.
doc: Option<String>Documentation.
Implementations§
Trait Implementations§
impl Eq for EnumDef
impl StructuralPartialEq for EnumDef
Auto Trait Implementations§
impl Freeze for EnumDef
impl RefUnwindSafe for EnumDef
impl Send for EnumDef
impl Sync for EnumDef
impl Unpin for EnumDef
impl UnsafeUnpin for EnumDef
impl UnwindSafe for EnumDef
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