pub struct Enum { /* private fields */ }
Expand description
Defines an enumeration.
Implementations§
Source§impl Enum
impl Enum
Sourcepub fn ty(&self) -> &Type
pub fn ty(&self) -> &Type
Returns a reference to the enum’s type.
§Examples
use rust_codegen::Enum;
let foo_enum = Enum::new("Foo");
println!("{:?}", foo_enum.ty());
Sourcepub fn new_variant(&mut self, name: &str) -> &mut Variant
pub fn new_variant(&mut self, name: &str) -> &mut Variant
Sourcepub fn push_variant(&mut self, item: Variant) -> &mut Self
pub fn push_variant(&mut self, item: Variant) -> &mut Self
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