Enum darling_core::ast::Data  [−][src]
A struct or enum body.
V is the type which receives any encountered variants, and F receives struct fields.
Variants
Enum(Vec<V>)Struct(Fields<F>)Implementations
impl<V, F> Data<V, F>[src]
pub fn empty_from(src: &Data) -> Self[src]
Creates an empty body of the same shape as the passed-in body.
pub fn as_ref<'a>(&'a self) -> Data<&'a V, &'a F>[src]
Creates a new Data<&'a V, &'a F> instance from Data<V, F>.
pub fn map_enum_variants<T, U>(self, map: T) -> Data<U, F> where
    T: FnMut(V) -> U, [src]
T: FnMut(V) -> U,
Applies a function V -> U on enum variants, if this is an enum.
pub fn map_struct_fields<T, U>(self, map: T) -> Data<V, U> where
    T: FnMut(F) -> U, [src]
T: FnMut(F) -> U,
Applies a function F -> U on struct fields, if this is a struct.
pub fn map_struct<T, U>(self, map: T) -> Data<V, U> where
    T: FnMut(Fields<F>) -> Fields<U>, [src]
T: FnMut(Fields<F>) -> Fields<U>,
Applies a function to the Fields if this is a struct.
pub fn take_struct(self) -> Option<Fields<F>>[src]
Consumes the Data, returning Fields<F> if it was a struct.
pub fn take_enum(self) -> Option<Vec<V>>[src]
Consumes the Data, returning Vec<V> if it was an enum.
pub fn is_enum(&self) -> bool[src]
Returns true if this instance is Data::Enum.
pub fn is_struct(&self) -> bool[src]
Returns true if this instance is Data::Struct.
impl<V: FromVariant, F: FromField> Data<V, F>[src]
Trait Implementations
impl<V: Clone, F: Clone> Clone for Data<V, F>[src]
impl<V: Debug, F: Debug> Debug for Data<V, F>[src]
impl<V: Eq, F: Eq> Eq for Data<V, F>[src]
impl<V: PartialEq, F: PartialEq> PartialEq<Data<V, F>> for Data<V, F>[src]
impl<V, F> StructuralEq for Data<V, F>[src]
impl<V, F> StructuralPartialEq for Data<V, F>[src]
impl<V: UsesLifetimes, F: UsesLifetimes> UsesLifetimes for Data<V, F>[src]
fn uses_lifetimes<'a>(
    &self, 
    options: &Options, 
    lifetimes: &'a LifetimeSet
) -> LifetimeRefSet<'a>[src]
&self,
options: &Options,
lifetimes: &'a LifetimeSet
) -> LifetimeRefSet<'a>
fn uses_lifetimes_cloned(
    &self, 
    options: &Options, 
    lifetimes: &LifetimeSet
) -> LifetimeSet[src]
&self,
options: &Options,
lifetimes: &LifetimeSet
) -> LifetimeSet
impl<V: UsesTypeParams, F: UsesTypeParams> UsesTypeParams for Data<V, F>[src]
fn uses_type_params<'a>(
    &self, 
    options: &Options, 
    type_set: &'a IdentSet
) -> IdentRefSet<'a>[src]
&self,
options: &Options,
type_set: &'a IdentSet
) -> IdentRefSet<'a>
fn uses_type_params_cloned(
    &self, 
    options: &Options, 
    type_set: &IdentSet
) -> IdentSet[src]
&self,
options: &Options,
type_set: &IdentSet
) -> IdentSet
Auto Trait Implementations
impl<V, F> RefUnwindSafe for Data<V, F> where
    F: RefUnwindSafe,
    V: RefUnwindSafe, 
F: RefUnwindSafe,
V: RefUnwindSafe,
impl<V, F> Send for Data<V, F> where
    F: Send,
    V: Send, 
F: Send,
V: Send,
impl<V, F> Sync for Data<V, F> where
    F: Sync,
    V: Sync, 
F: Sync,
V: Sync,
impl<V, F> Unpin for Data<V, F> where
    F: Unpin,
    V: Unpin, 
F: Unpin,
V: Unpin,
impl<V, F> UnwindSafe for Data<V, F> where
    F: UnwindSafe,
    V: UnwindSafe, 
F: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
    T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
    T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
    T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
    U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
    T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
    U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, [src]
U: TryFrom<T>,