pub struct EnumDef<Mods, Name, Entries> {
pub mods: Mods,
pub name: Name,
pub entries: Entries,
}Expand description
Defines an enum.
In order to use or refer to an enum, you can use AssociatedItem together with NamedTuple or StructCall.
Fields§
§mods: ModsThe modifiers on the type. Must be a sequence.
name: NameThe name of the enum
entries: EntriesThe enum entries. Must be a sequence, each entry will be written on a new line with a comma
As for the entries themselves, it is suggested to use NamedTuple or StructCall depending on which kind of enum entry you want to create.
Trait Implementations§
Source§impl<Mods, Name, Entries> CanHaveAttributes for EnumDef<Mods, Name, Entries>
impl<Mods, Name, Entries> CanHaveAttributes for EnumDef<Mods, Name, Entries>
Source§fn with_attributes<Attr>(self, attr: Attr) -> WithAttributes<Attr, Self>
fn with_attributes<Attr>(self, attr: Attr) -> WithAttributes<Attr, Self>
Adds attributes to this writable
Auto Trait Implementations§
impl<Mods, Name, Entries> Freeze for EnumDef<Mods, Name, Entries>
impl<Mods, Name, Entries> RefUnwindSafe for EnumDef<Mods, Name, Entries>
impl<Mods, Name, Entries> Send for EnumDef<Mods, Name, Entries>
impl<Mods, Name, Entries> Sync for EnumDef<Mods, Name, Entries>
impl<Mods, Name, Entries> Unpin for EnumDef<Mods, Name, Entries>
impl<Mods, Name, Entries> UnwindSafe for EnumDef<Mods, Name, Entries>
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