Expand description
Equivalent to syn::Fields
, but replaces the AST element with a generic.
Fields
style: Style
fields: Vec<T, Global>
Implementations
sourceimpl<T> Fields<T>
impl<T> Fields<T>
pub fn empty_from(vd: &Fields) -> Fields<T>
sourcepub fn split(self) -> (Style, Vec<T, Global>)
pub fn split(self) -> (Style, Vec<T, Global>)
Splits the Fields
into its style and fields for further processing.
Returns an empty Vec
for Unit
data.
sourcepub fn is_newtype(&self) -> bool
pub fn is_newtype(&self) -> bool
Returns true if this variant’s data makes it a newtype.
pub fn is_unit(&self) -> bool
pub fn is_tuple(&self) -> bool
pub fn is_struct(&self) -> bool
pub fn as_ref(&self) -> Fields<&T>
pub fn map<F, U>(self, map: F) -> Fields<U>where
F: FnMut(T) -> U,
pub fn iter(&self) -> Iter<'_, T>
Trait Implementations
sourceimpl<T> IntoIterator for Fields<T>
impl<T> IntoIterator for Fields<T>
sourceimpl<T> PartialEq<Fields<T>> for Fields<T>where
T: PartialEq<T>,
impl<T> PartialEq<Fields<T>> for Fields<T>where
T: PartialEq<T>,
sourceimpl<T> ToTokens for Fields<T>where
T: ToTokens,
impl<T> ToTokens for Fields<T>where
T: ToTokens,
sourcefn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
sourcefn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
sourcefn into_token_stream(self) -> TokenStream
fn into_token_stream(self) -> TokenStream
sourceimpl<T> UsesLifetimes for Fields<T>where
T: UsesLifetimes,
impl<T> UsesLifetimes for Fields<T>where
T: UsesLifetimes,
sourcefn uses_lifetimes(
&self,
options: &Options,
lifetimes: &'a HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Lifetime, BuildHasherDefault<FnvHasher>>
fn uses_lifetimes(
&self,
options: &Options,
lifetimes: &'a HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Lifetime, BuildHasherDefault<FnvHasher>>
Returns the subset of the queried lifetimes that are used by the implementing syntax element. Read more
sourcefn uses_lifetimes_cloned(
&self,
options: &Options,
lifetimes: &HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
) -> HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
fn uses_lifetimes_cloned(
&self,
options: &Options,
lifetimes: &HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
) -> HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
Find all used lifetimes, then clone them and return that set.
sourceimpl<T> UsesTypeParams for Fields<T>where
T: UsesTypeParams,
impl<T> UsesTypeParams for Fields<T>where
T: UsesTypeParams,
sourcefn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
fn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
Returns the subset of the queried type parameters that are used by the implementing syntax element. Read more
sourcefn uses_type_params_cloned(
&self,
options: &Options,
type_set: &HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<Ident, BuildHasherDefault<FnvHasher>>
fn uses_type_params_cloned(
&self,
options: &Options,
type_set: &HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<Ident, BuildHasherDefault<FnvHasher>>
Find all type params using
uses_type_params
, then clone the found values and return the set.impl<T> Eq for Fields<T>where
T: Eq,
Auto Trait Implementations
impl<T> RefUnwindSafe for Fields<T>where
T: RefUnwindSafe,
impl<T> !Send for Fields<T>
impl<T> !Sync for Fields<T>
impl<T> Unpin for Fields<T>where
T: Unpin,
impl<T> UnwindSafe for Fields<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'i, I, T> CollectLifetimes for Twhere
T: IntoIterator<Item = &'i I>,
I: 'i + UsesLifetimes,
impl<'i, I, T> CollectLifetimes for Twhere
T: IntoIterator<Item = &'i I>,
I: 'i + UsesLifetimes,
sourcefn collect_lifetimes(
self,
options: &Options,
lifetimes: &'a HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Lifetime, BuildHasherDefault<FnvHasher>>
fn collect_lifetimes(
self,
options: &Options,
lifetimes: &'a HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Lifetime, BuildHasherDefault<FnvHasher>>
Consume an iterator, accumulating all lifetimes in the elements which occur in
lifetimes
.sourcefn collect_lifetimes_cloned(
self,
options: &Options,
lifetimes: &HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
) -> HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
fn collect_lifetimes_cloned(
self,
options: &Options,
lifetimes: &HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
) -> HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
Consume an iterator using
collect_lifetimes
, then clone all found lifetimes and return that set.sourceimpl<'i, T, I> CollectTypeParams for Twhere
T: IntoIterator<Item = &'i I>,
I: 'i + UsesTypeParams,
impl<'i, T, I> CollectTypeParams for Twhere
T: IntoIterator<Item = &'i I>,
I: 'i + UsesTypeParams,
sourcefn collect_type_params(
self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
fn collect_type_params(
self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
Consume an iterator, accumulating all type parameters in the elements which occur in
type_set
.sourcefn collect_type_params_cloned(
self,
options: &Options,
type_set: &HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<Ident, BuildHasherDefault<FnvHasher>>
fn collect_type_params_cloned(
self,
options: &Options,
type_set: &HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<Ident, BuildHasherDefault<FnvHasher>>
Consume an iterator using
collect_type_params
, then clone all found type params and return that set.sourceimpl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
sourcefn 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. Read more