struct Enum<'a> {
enum_ident: &'a Ident,
variants: Vec<Container<'a>>,
}
Expand description
Describes derivation input of an enum.
Fields§
§enum_ident: &'a Ident
§variants: Vec<Container<'a>>
Implementations§
Source§impl<'a> Enum<'a>
impl<'a> Enum<'a>
Sourcefn new(
data_enum: &'a DataEnum,
ident: &'a Ident,
options: ContainerOptions,
) -> Result<Self>
fn new( data_enum: &'a DataEnum, ident: &'a Ident, options: ContainerOptions, ) -> Result<Self>
Construct a new enum representation.
data_enum
is the syn
representation of the input enum, ident
is the
Identifier
of the enum.
Sourcefn build(&self, ctx: &Ctx) -> TokenStream
fn build(&self, ctx: &Ctx) -> TokenStream
Build derivation body for enums.
Auto Trait Implementations§
impl<'a> Freeze for Enum<'a>
impl<'a> RefUnwindSafe for Enum<'a>
impl<'a> !Send for Enum<'a>
impl<'a> !Sync for Enum<'a>
impl<'a> Unpin for Enum<'a>
impl<'a> UnwindSafe for Enum<'a>
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
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)The largest safe length for a
[Self]
. Read more