[−][src]Struct derive_utils::EnumImpl
A builder for implementing a trait for enums.
Implementations
impl<'a> EnumImpl<'a>
[src]
pub fn new(data: &'a EnumData) -> Self
[src]
Constructs a new EnumImpl
.
pub fn from_trait<I>(
data: &'a EnumData,
trait_path: Path,
supertraits_types: I,
trait_def: ItemTrait
) -> Result<Self> where
I: IntoIterator<Item = Ident>,
I::IntoIter: ExactSizeIterator,
[src]
data: &'a EnumData,
trait_path: Path,
supertraits_types: I,
trait_def: ItemTrait
) -> Result<Self> where
I: IntoIterator<Item = Ident>,
I::IntoIter: ExactSizeIterator,
Constructs a new EnumImpl
from a trait definition.
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
Panics
Panics if a trait method has a body.
pub fn set_trait(&mut self, path: Path)
[src]
pub fn push_generic_param(&mut self, param: GenericParam)
[src]
Appends a generic type parameter to the back of generics.
pub fn push_where_predicate(&mut self, predicate: WherePredicate)
[src]
Appends a predicate to the back of where
-clause.
pub fn push_item(&mut self, item: ImplItem)
[src]
Appends an item to impl items.
pub fn push_method(&mut self, item: TraitItemMethod) -> Result<()>
[src]
Appends a method to impl items.
A 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>
Panics
Panics if a trait method has a body.
pub fn append_items_from_trait(&mut self, trait_def: ItemTrait) -> Result<()>
[src]
Appends items from a trait definition to impl items.
See EnumImpl::from_trait
for supported item types.
Panics
Panics if a trait method has a body.
pub fn build(self) -> TokenStream
[src]
pub fn build_impl(self) -> ItemImpl
[src]
Auto Trait Implementations
impl<'a> !RefUnwindSafe for EnumImpl<'a>
impl<'a> !Send for EnumImpl<'a>
impl<'a> !Sync for EnumImpl<'a>
impl<'a> Unpin for EnumImpl<'a>
impl<'a> !UnwindSafe for EnumImpl<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,