pub struct EnumDef<Attr, Mods, Name, Entries> {
pub attr: Attr,
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§
§attr: AttrThe attributes. Must be a sequence.
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<O, Attr, Mods, Name, Entries> Writable<O> for EnumDef<Attr, Mods, Name, Entries>where
O: Output,
Attr: WritableSeq<O>,
Mods: WritableSeq<O>,
Name: Writable<O>,
Entries: WritableSeq<O>,
impl<O, Attr, Mods, Name, Entries> Writable<O> for EnumDef<Attr, Mods, Name, Entries>where
O: Output,
Attr: WritableSeq<O>,
Mods: WritableSeq<O>,
Name: Writable<O>,
Entries: WritableSeq<O>,
Auto Trait Implementations§
impl<Attr, Mods, Name, Entries> Freeze for EnumDef<Attr, Mods, Name, Entries>
impl<Attr, Mods, Name, Entries> RefUnwindSafe for EnumDef<Attr, Mods, Name, Entries>
impl<Attr, Mods, Name, Entries> Send for EnumDef<Attr, Mods, Name, Entries>
impl<Attr, Mods, Name, Entries> Sync for EnumDef<Attr, Mods, Name, Entries>
impl<Attr, Mods, Name, Entries> Unpin for EnumDef<Attr, Mods, Name, Entries>
impl<Attr, Mods, Name, Entries> UnwindSafe for EnumDef<Attr, 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