Enum darling::ast::Data [−][src]
Expand description
A struct or enum body.
V
is the type which receives any encountered variants, and F
receives struct fields.
Variants
Struct(Fields<F>)
Tuple Fields of Struct
0: Fields<F>
Implementations
Creates an empty body of the same shape as the passed-in body.
Panics
This function will panic if passed syn::Data::Union
.
Creates an empty body of the same shape as the passed-in body.
darling
does not support unions; calling this function with a union body will return an error.
Applies a function V -> U
on enum variants, if this is an enum.
Applies a function F -> U
on struct fields, if this is a struct.
Applies a function to the Fields
if this is a struct.
Consumes the Data
, returning Fields<F>
if it was a struct.
Consumes the Data
, returning Vec<V>
if it was an enum.
Trait Implementations
pub fn uses_lifetimes(
&self,
options: &Options,
lifetimes: &'a HashSet<Lifetime, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Lifetime, BuildHasherDefault<FnvHasher>>
pub 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
fn 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.
pub fn uses_type_params(
&self,
options: &Options,
type_set: &'a HashSet<Ident, BuildHasherDefault<FnvHasher>>
) -> HashSet<&'a Ident, BuildHasherDefault<FnvHasher>>
pub 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
fn 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.
Auto Trait Implementations
impl<V, F> RefUnwindSafe for Data<V, F> where
F: RefUnwindSafe,
V: RefUnwindSafe,
impl<V, F> UnwindSafe for Data<V, F> where
F: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more