Struct darling_core::ast::Fields
source · Expand description
Equivalent to syn::Fields
, but replaces the AST element with a generic.
Fields§
§style: Style
§fields: Vec<T>
Implementations§
source§impl<T> Fields<T>
impl<T> Fields<T>
pub fn empty_from(vd: &Fields) -> Self
sourcepub fn split(self) -> (Style, Vec<T>)
pub fn split(self) -> (Style, Vec<T>)
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§
source§impl<T> IntoIterator for Fields<T>
impl<T> IntoIterator for Fields<T>
source§impl<T: PartialEq> PartialEq<Fields<T>> for Fields<T>
impl<T: PartialEq> PartialEq<Fields<T>> for Fields<T>
source§impl<T: ToTokens> ToTokens for Fields<T>
impl<T: ToTokens> ToTokens for Fields<T>
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,
source§impl<T: UsesLifetimes> UsesLifetimes for Fields<T>
impl<T: UsesLifetimes> UsesLifetimes for Fields<T>
source§fn uses_lifetimes<'a>(
&self,
options: &Options,
lifetimes: &'a LifetimeSet
) -> LifetimeRefSet<'a>
fn uses_lifetimes<'a>(
&self,
options: &Options,
lifetimes: &'a LifetimeSet
) -> LifetimeRefSet<'a>
Returns the subset of the queried lifetimes that are used by the implementing syntax element. Read more
source§fn uses_lifetimes_cloned(
&self,
options: &Options,
lifetimes: &LifetimeSet
) -> LifetimeSet
fn uses_lifetimes_cloned(
&self,
options: &Options,
lifetimes: &LifetimeSet
) -> LifetimeSet
Find all used lifetimes, then clone them and return that set.
source§impl<T: UsesTypeParams> UsesTypeParams for Fields<T>
impl<T: UsesTypeParams> UsesTypeParams for Fields<T>
source§fn uses_type_params<'a>(
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>
fn uses_type_params<'a>(
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>
Returns the subset of the queried type parameters that are used by the implementing syntax element. Read more