Enum darling_core::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]

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

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

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 VariantData if this is a struct.

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

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

Returns true if this instance is Body::Enum.

Returns true if this instance is Body::Struct.

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

Attempt to convert from a syn::Body instance.

Trait Implementations

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

Formats the value using the given formatter.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

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

This method tests for !=.

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