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
sourceimpl<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<'a>(&'a self) -> Fields<&'a 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: UsesLifetimes> UsesLifetimes for Fields<T>
impl<T: UsesLifetimes> UsesLifetimes for Fields<T>
sourcefn 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
sourcefn 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.
sourceimpl<T: UsesTypeParams> UsesTypeParams for Fields<T>
impl<T: UsesTypeParams> UsesTypeParams for Fields<T>
sourcefn 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
sourcefn uses_type_params_cloned(
&self,
options: &Options,
type_set: &IdentSet
) -> IdentSet
fn uses_type_params_cloned(
&self,
options: &Options,
type_set: &IdentSet
) -> IdentSet
Find all type params using uses_type_params
, then clone the found values and return the set.
impl<T: Eq> Eq for Fields<T>
impl<T> StructuralEq for Fields<T>
impl<T> StructuralPartialEq for Fields<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Fields<T> where
T: RefUnwindSafe,
impl<T> Send for Fields<T> where
T: Send,
impl<T> Sync for Fields<T> where
T: Sync,
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more