Struct binary_util::Enum
source · pub struct Enum { /* private fields */ }
Expand description
Defines an enumeration.
Implementations§
source§impl Enum
impl Enum
sourcepub fn bound<T>(&mut self, name: &str, ty: T) -> &mut Enumwhere
T: Into<Type>,
pub fn bound<T>(&mut self, name: &str, ty: T) -> &mut Enumwhere T: Into<Type>,
Add a where
bound to the enum.
sourcepub fn derive(&mut self, name: &str) -> &mut Enum
pub fn derive(&mut self, name: &str) -> &mut Enum
Add a new type that the struct should derive.
sourcepub fn allow(&mut self, allow: &str) -> &mut Enum
pub fn allow(&mut self, allow: &str) -> &mut Enum
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 Enum
pub fn push_variant(&mut self, item: Variant) -> &mut Enum
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§
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