pub struct Enum { /* private fields */ }Expand description
Defines an enumeration.
Implementations§
Source§impl Enum
impl Enum
Sourcepub fn bound<T>(&mut self, name: impl ToString, ty: T) -> &mut Self
pub fn bound<T>(&mut self, name: impl ToString, ty: T) -> &mut Self
Add a where bound to the enum.
Sourcepub fn derive(&mut self, name: impl ToString) -> &mut Self
pub fn derive(&mut self, name: impl ToString) -> &mut Self
Add a new type that the struct should derive.
Sourcepub fn allow(&mut self, allow: impl ToString) -> &mut Self
pub fn allow(&mut self, allow: impl ToString) -> &mut Self
Specify lint attribute to supress a warning or error.
Sourcepub fn new_variant(&mut self, name: impl ToString) -> &mut Variant
pub fn new_variant(&mut self, name: impl ToString) -> &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