Struct macroific::attr_parse::FieldWithOpts
source · pub struct FieldWithOpts<O> {
pub field: Field,
pub options: O,
}
Available on crate feature
attr_parse
only.Fields§
§field: Field
§options: O
Implementations§
source§impl<O> FieldWithOpts<O>where
O: AttributeOptions,
impl<O> FieldWithOpts<O>where O: AttributeOptions,
sourcepub fn from_predicate<F>(
field: Field,
predicate: F
) -> Result<FieldWithOpts<O>, Error>where
F: FnMut(&Attribute) -> bool,
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.
sourcepub fn from_attr_name(
input: Field,
attr_name: &str
) -> Result<FieldWithOpts<O>, Error>
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>
impl<O> Deref for FieldWithOpts<O>
source§impl<O> DerefMut for FieldWithOpts<O>
impl<O> DerefMut for FieldWithOpts<O>
source§impl<O> ToTokens for FieldWithOpts<O>
impl<O> ToTokens for FieldWithOpts<O>
source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
source§fn into_token_stream(self) -> TokenStream
fn into_token_stream(self) -> TokenStream
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere T: Spanned + ?Sized,
source§fn span(&self) -> Span
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.