[][src]Struct derive_utils::EnumData

pub struct EnumData { /* fields omitted */ }

A structure to make trait implementation to enums more efficient.

Methods

impl EnumData[src]

pub fn new<E: MaybeEnum>(maybe_enum: &E) -> Result<Self>[src]

Constructs a new EnumData.

pub fn make_impl<'a>(&'a self) -> Result<EnumImpl<'a>>[src]

Constructs a new EnumImpl.

pub fn impl_with_capacity<'a>(&'a self, capacity: usize) -> Result<EnumImpl<'a>>[src]

Constructs a new EnumImpl with the specified capacity..

pub fn make_impl_trait<'a, I>(
    &'a self,
    trait_path: Path,
    supertraits_types: I,
    item: ItemTrait
) -> Result<EnumImpl<'a>> where
    I: IntoIterator<Item = Ident>,
    I::IntoIter: ExactSizeIterator
[src]

Constructs a new EnumImpl from ItemTrait.

TraitItem::Method that has the first argument other than the following is error:

  • &self
  • &mut self
  • self
  • mut self
  • self: Pin<&Self>
  • self: Pin<&mut Self>

The following items are ignored:

  • Generic associated types (GAT) (TraitItem::Method that has generics)
  • TraitItem::Const
  • TraitItem::Macro
  • TraitItem::Verbatim

pub fn impl_trait_with_capacity<'a, I>(
    &'a self,
    capacity: usize,
    trait_path: Path,
    supertraits_types: I,
    item: ItemTrait
) -> Result<EnumImpl<'a>> where
    I: IntoIterator<Item = Ident>,
    I::IntoIter: ExactSizeIterator
[src]

Constructs a new EnumImpl from ItemTrait with the specified capacity.

See EnumData::make_impl_trait for supported item types.

pub const fn ident(&self) -> &Ident[src]

pub const fn generics(&self) -> &Generics[src]

pub fn variants(&self) -> &[Ident][src]

pub fn fields(&self) -> &[Type][src]

Auto Trait Implementations

impl !Send for EnumData

impl !Sync for EnumData

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]