pub struct Enum { /* private fields */ }
Expand description
Defines an enumeration.
Implementations§
Source§impl Enum
impl Enum
Sourcepub fn type_def_mut(&mut self) -> &mut TypeDef
pub fn type_def_mut(&mut self) -> &mut TypeDef
Return a mutable reference to the type definition.
Sourcepub fn derive(&mut self, name: &str) -> &mut Self
pub fn derive(&mut self, name: &str) -> &mut Self
Add a new type that the struct should derive.
Sourcepub fn allow(&mut self, allow: &str) -> &mut Self
pub fn allow(&mut self, allow: &str) -> &mut Self
Specify lint attribute to supress a warning or error.
Sourcepub fn new_variant(&mut self, name: &str) -> &mut Variant
pub fn new_variant(&mut self, name: &str) -> &mut Variant
Push a variant to the enum, returning a mutable reference to it.
Sourcepub fn push_variant(&mut self, item: Variant) -> &mut Self
pub fn push_variant(&mut self, item: Variant) -> &mut Self
Push a variant to the enum.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Enum
impl RefUnwindSafe for Enum
impl Send for Enum
impl Sync for Enum
impl Unpin for Enum
impl UnwindSafe for Enum
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