[][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>(maybe_enum: &E) -> Result<Self> where
    E: MaybeEnum
[src]

Constructs a new EnumData.

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

Constructs a new EnumImpl.

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

Constructs a new EnumImpl with the specified capacity..

pub fn make_impl_trait<I>(
    &self,
    trait_path: Path,
    supertraits_types: I,
    item: ItemTrait
) -> Result<EnumImpl> 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<I>(
    &self,
    capacity: usize,
    trait_path: Path,
    supertraits_types: I,
    item: ItemTrait
) -> Result<EnumImpl> 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.

Auto Trait Implementations

impl !Send for EnumData

impl Unpin for EnumData

impl !Sync for EnumData

impl UnwindSafe for EnumData

impl !RefUnwindSafe 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]