[−][src]Struct derive_utils::EnumData
A structure to make trait implementation to enums more efficient.
Methods
impl EnumData
[src]
pub fn from_item(item: &ItemEnum) -> Result<Self>
[src]
Constructs a new EnumData
from &ItemEnum
.
pub fn from_derive(ast: &DeriveInput) -> Result<Self>
[src]
Constructs a new EnumData
from &DeriveInput
.
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]
&'a self,
trait_path: Path,
supertraits_types: I,
item: ItemTrait
) -> Result<EnumImpl<'a>> where
I: IntoIterator<Item = Ident>,
I::IntoIter: ExactSizeIterator,
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]
&'a self,
capacity: usize,
trait_path: Path,
supertraits_types: I,
item: ItemTrait
) -> Result<EnumImpl<'a>> where
I: IntoIterator<Item = Ident>,
I::IntoIter: ExactSizeIterator,
Constructs a new EnumImpl
from ItemTrait
with the specified capacity.
See EnumData::make_impl_trait
for supported item types.
pub fn ident(&self) -> &Ident
[src]
pub fn generics(&self) -> &Generics
[src]
pub fn variants(&self) -> &[Ident]
[src]
pub fn fields(&self) -> &[Type]
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,