Enum serde_reflection::ContainerFormat[][src]

pub enum ContainerFormat {
    UnitStruct,
    NewTypeStruct(Box<Format>),
    TupleStruct(Vec<Format>),
    Struct(Vec<Named<Format>>),
    Enum(BTreeMap<u32, Named<VariantFormat>>),
}
Expand description

Serde-based serialization format for named “container” types. In Rust, those are enums and structs.

Variants

UnitStruct

An empty struct, e.g. struct A.

NewTypeStruct(Box<Format>)

A struct with a single unnamed parameter, e.g. struct A(u16)

TupleStruct(Vec<Format>)

A struct with several unnamed parameters, e.g. struct A(u16, u32)

Struct(Vec<Named<Format>>)

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

Enum(BTreeMap<u32, Named<VariantFormat>>)

An enum, that is, an enumeration of variants. Each variant has a unique name and index within the enum.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Visit all the formats in self in a depth-first way. Variables are not supported and will cause an error. Read more

Mutably visit all the formats in self in a depth-first way. Read more

Update variables and add missing enum variants so that the terms match. This is a special case of term unification: Read more

Whether this format is a variable with no known value yet.

Finalize the formats within self by removing variables and making sure that all eligible tuples are compressed into a TupleArray. Return an error if any variable has an unknown value. Read more

Attempt to remove known variables within self. Silently abort if some variables have unknown values. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.