Enum darling_core::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
Enum(Vec<V>)
Tuple Fields of Enum
0: Vec<V>
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.
Trait Implementations
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
Find all used lifetimes, then clone them and return that set.
Returns the subset of the queried type parameters that are used by the implementing syntax element. Read more
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