Struct ImplArgs

Source
pub struct ImplArgs {
    pub path_arguments: PathArguments,
    pub ignores: Vec<Member>,
    pub using: Option<Member>,
    pub clause: Option<WhereClause>,
}
Expand description

Arguments passed to ImplTrait implementation methods

Fields§

§path_arguments: PathArguments

Path arguments to trait

Example: if the target is Deref<Target = T>, this is <Target = T>. This is always empty unless ImplTrait::support_path_arguments returns true.

§ignores: Vec<Member>

Fields ignored in attribute

§using: Option<Member>

Field specified to ‘use’ in attribute

§clause: Option<WhereClause>

Where clause added to attribute

Implementations§

Source§

impl ImplArgs

Source

pub fn ignore(&self, member: &Member) -> bool

If true, this field is ignored

Source

pub fn ignore_named(&self, ident: &Ident) -> bool

If true, this named field is ignored

Source

pub fn ignore_unnamed(&self, index: &Index) -> bool

If true, this unnamed field is ignored

Source

pub fn using_member(&self) -> Option<&Member>

Field to “use”, if any

Source

pub fn using_field<'b>(&self, fields: &'b Fields) -> Option<&'b Field>

Find field to “use”, if any

Source

pub fn for_fields<'f>( &self, fields: &'f Fields, f: impl FnMut(Member, &'f Field), )

Call the given closure over all non-ignored fields

Source

pub fn for_fields_iter<'f>( &self, fields: impl Iterator<Item = (usize, &'f Field)>, f: impl FnMut(Member, &'f Field), )

Call the given closure over all non-ignored fields

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.