Enum macroific::attr_parse::FieldsWithOpts
source · pub enum FieldsWithOpts<O> {
Named {
brace_token: Brace,
fields: Punctuated<FieldWithOpts<O>, Comma>,
},
Unnamed {
paren_token: Paren,
fields: Punctuated<FieldWithOpts<O>, Comma>,
},
Unit,
}
Available on crate feature
attr_parse
only.Variants§
Implementations§
source§impl<O> FieldsWithOpts<O>where
O: AttributeOptions,
impl<O> FieldsWithOpts<O>where O: AttributeOptions,
sourcepub fn from_predicate<F>(
fields: Fields,
predicate: F
) -> Result<FieldsWithOpts<O>, Error>where
F: FnMut(&Attribute) -> bool,
pub fn from_predicate<F>( fields: Fields, predicate: F ) -> Result<FieldsWithOpts<O>, Error>where F: FnMut(&Attribute) -> bool,
Construct from the given fields using attributes the predicate returns true for. The remaining attributes will be kept on the field.
sourcepub fn from_attr_name(
input: Fields,
attr_name: &str
) -> Result<FieldsWithOpts<O>, Error>
pub fn from_attr_name( input: Fields, attr_name: &str ) -> Result<FieldsWithOpts<O>, Error>
from_predicate
shorthand for filtering by attribute name
Trait Implementations§
source§impl<O> ToTokens for FieldsWithOpts<O>
impl<O> ToTokens for FieldsWithOpts<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) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere Self: Sized,
Auto Trait Implementations§
impl<O> RefUnwindSafe for FieldsWithOpts<O>where O: RefUnwindSafe,
impl<O> !Send for FieldsWithOpts<O>
impl<O> !Sync for FieldsWithOpts<O>
impl<O> Unpin for FieldsWithOpts<O>where O: Unpin,
impl<O> UnwindSafe for FieldsWithOpts<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.