Enum darling_core::ast::Data [] [src]

pub enum Data<V, F> {
    Enum(Vec<V>),
    Struct(Fields<F>),
}

A struct or enum body.

V is the type which receives any encountered variants, and F receives struct fields.

Variants

Methods

impl<V, F> Data<V, F>
[src]

[src]

Creates an empty body of the same shape as the passed-in body.

[src]

Creates a new Data<&'a V, &'a F> instance from Data<V, F>.

[src]

Applies a function V -> U on enum variants, if this is an enum.

[src]

Applies a function F -> U on struct fields, if this is a struct.

[src]

Applies a function to the Fields if this is a struct.

[src]

Consumes the Data, returning Fields<F> if it was a struct.

[src]

Consumes the Data, returning Vec<V> if it was an enum.

[src]

Returns true if this instance is Data::Enum.

[src]

Returns true if this instance is Data::Struct.

impl<V: FromVariant, F: FromField> Data<V, F>
[src]

[src]

Attempt to convert from a syn::Data instance.

Trait Implementations

impl<V: Debug, F: Debug> Debug for Data<V, F>
[src]

[src]

Formats the value using the given formatter. Read more

impl<V: Clone, F: Clone> Clone for Data<V, F>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<V: PartialEq, F: PartialEq> PartialEq for Data<V, F>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<V: Eq, F: Eq> Eq for Data<V, F>
[src]

impl<V: UsesTypeParams, F: UsesTypeParams> UsesTypeParams for Data<V, F>
[src]

[src]

Returns the subset of the queried type parameters that are used by the implementing syntax element. Read more

impl<V: UsesLifetimes, F: UsesLifetimes> UsesLifetimes for Data<V, F>
[src]

[src]

Returns the subset of the queried lifetimes that are used by the implementing syntax element. Read more

Auto Trait Implementations

impl<V, F> Send for Data<V, F> where
    F: Send,
    V: Send

impl<V, F> Sync for Data<V, F> where
    F: Sync,
    V: Sync