pub struct Enum { /* private fields */ }
Expand description
Defines an enumeration.
Implementations
sourceimpl Enum
impl Enum
sourcepub fn bound<T>(&mut self, name: &str, ty: T) -> &mut Selfwhere
T: Into<Type>,
pub fn bound<T>(&mut self, name: &str, ty: T) -> &mut Selfwhere
T: Into<Type>,
Add a where
bound to the enum.
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: impl Into<String>) -> &mut Variant
pub fn new_variant(&mut self, name: impl Into<String>) -> &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 RefUnwindSafe for Enum
impl Send for Enum
impl Sync for Enum
impl Unpin for Enum
impl UnwindSafe for Enum
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more