[][src]Enum serde_reflection::VariantFormat

pub enum VariantFormat {
    Variable(Variable<VariantFormat>),
    Unit,
    NewType(Box<Format>),
    Tuple(Vec<Format>),
    Struct(Vec<Named<Format>>),
}

Description of a variant in an enum.

Variants

A variant whose format is initially unknown. Used internally for tracing. Not (de)serializable.

Unit

A variant without parameters, e.g. A in enum X { A }

NewType(Box<Format>)

A variant with a single unnamed parameter, e.g. A in enum X { A(u16) }

Tuple(Vec<Format>)

A struct with several unnamed parameters, e.g. A in enum X { A(u16, u32) }

Struct(Vec<Named<Format>>)

A struct with named parameters, e.g. A in enum X { A { a: Foo } }

Implementations

impl VariantFormat[src]

pub fn unknown() -> Self[src]

Return a format made of a fresh variable with no known value.

Trait Implementations

impl Clone for VariantFormat[src]

impl Debug for VariantFormat[src]

impl Default for VariantFormat[src]

impl<'de> Deserialize<'de> for VariantFormat[src]

impl Eq for VariantFormat[src]

impl FormatHolder for VariantFormat[src]

impl PartialEq<VariantFormat> for VariantFormat[src]

impl Serialize for VariantFormat[src]

impl StructuralEq for VariantFormat[src]

impl StructuralPartialEq for VariantFormat[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.