Enum darling::ast::Body [] [src]

pub enum Body<V, F> {
    Enum(Vec<V>),
    Struct(VariantData<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> Body<V, F>
[src]

[src]

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

[src]

Creates a new Body<&'a V, &'a F> instance from Body<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 VariantData if this is a struct.

[src]

Consumes the Body, returning VariantData<F> if it was a struct.

[src]

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

[src]

Returns true if this instance is Body::Enum.

[src]

Returns true if this instance is Body::Struct.

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

[src]

Attempt to convert from a syn::Body instance.

Trait Implementations

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

[src]

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

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

[src]

[src]

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

[src]