pub struct FieldWithOpts<O> {
    pub field: Field,
    pub options: O,
}
Available on crate feature attr_parse only.
Expand description

A Field with options parsed.

Fields§

§field: Field§options: O

Implementations§

source§

impl<O> FieldWithOpts<O>where O: AttributeOptions,

source

pub fn from_predicate<F>( field: Field, predicate: F ) -> Result<FieldWithOpts<O>, Error>where F: FnMut(&Attribute) -> bool,

Construct from the given field using attributes the predicate returns true for. The remaining attributes will be kept on the field.

source

pub fn from_attr_name( input: Field, attr_name: &str ) -> Result<FieldWithOpts<O>, Error>

from_predicate shorthand for filtering by attribute name

Trait Implementations§

source§

impl<O> Deref for FieldWithOpts<O>

§

type Target = Field

The resulting type after dereferencing.
source§

fn deref(&self) -> &<FieldWithOpts<O> as Deref>::Target

Dereferences the value.
source§

impl<O> DerefMut for FieldWithOpts<O>

source§

fn deref_mut(&mut self) -> &mut <FieldWithOpts<O> as Deref>::Target

Mutably dereferences the value.
source§

impl<O> ToTokens for FieldWithOpts<O>

source§

fn to_tokens(&self, tokens: &mut TokenStream)

Write self to the given TokenStream. Read more
source§

fn to_token_stream(&self) -> TokenStream

Convert self directly into a TokenStream object. Read more
source§

fn into_token_stream(self) -> TokenStream

Convert self directly into a TokenStream object. Read more

Auto Trait Implementations§

§

impl<O> RefUnwindSafe for FieldWithOpts<O>where O: RefUnwindSafe,

§

impl<O> !Send for FieldWithOpts<O>

§

impl<O> !Sync for FieldWithOpts<O>

§

impl<O> Unpin for FieldWithOpts<O>where O: Unpin,

§

impl<O> UnwindSafe for FieldWithOpts<O>where O: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Spanned for Twhere T: Spanned + ?Sized,

source§

fn span(&self) -> Span

Returns a Span covering the complete contents of this syntax tree node, or Span::call_site() if this node is empty.
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.