EnumDef

Struct EnumDef 

Source
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: Mods

The modifiers on the type. Must be a sequence.

§name: Name

The name of the enum

§entries: Entries

The 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>

Source§

fn with_attributes<Attr>(self, attr: Attr) -> WithAttributes<Attr, Self>

Adds attributes to this writable
Source§

impl<O, Mods, Name, Entries> Writable<O> for EnumDef<Mods, Name, Entries>
where O: Output, Mods: WritableSeq<O>, Name: Writable<O>, Entries: WritableSeq<O>,

Source§

async fn write_to(&self, output: &mut O) -> Result<(), O::Error>

Writes to the output. Returns the output’s error upon failure. Read more

Auto Trait Implementations§

§

impl<Mods, Name, Entries> Freeze for EnumDef<Mods, Name, Entries>
where Mods: Freeze, Name: Freeze, Entries: Freeze,

§

impl<Mods, Name, Entries> RefUnwindSafe for EnumDef<Mods, Name, Entries>
where Mods: RefUnwindSafe, Name: RefUnwindSafe, Entries: RefUnwindSafe,

§

impl<Mods, Name, Entries> Send for EnumDef<Mods, Name, Entries>
where Mods: Send, Name: Send, Entries: Send,

§

impl<Mods, Name, Entries> Sync for EnumDef<Mods, Name, Entries>
where Mods: Sync, Name: Sync, Entries: Sync,

§

impl<Mods, Name, Entries> Unpin for EnumDef<Mods, Name, Entries>
where Mods: Unpin, Name: Unpin, Entries: Unpin,

§

impl<Mods, Name, Entries> UnwindSafe for EnumDef<Mods, Name, Entries>
where Mods: UnwindSafe, Name: UnwindSafe, Entries: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.