Enum serde_reflection::VariantFormat [−][src]
pub enum VariantFormat { Variable(Variable<VariantFormat>), Unit, NewType(Box<Format>), Tuple(Vec<Format>), Struct(Vec<Named<Format>>), }
Expand description
Description of a variant in an enum.
Variants
Variable(Variable<VariantFormat>)
A variant whose format is initially unknown. Used internally for tracing. Not (de)serializable.
A variant without parameters, e.g. A
in enum X { A }
A variant with a single unnamed parameter, e.g. A
in enum X { A(u16) }
A struct with several unnamed parameters, e.g. A
in enum X { A(u16, u32) }
A struct with named parameters, e.g. A
in enum X { A { a: Foo } }
Implementations
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl !RefUnwindSafe for VariantFormat
impl !Send for VariantFormat
impl !Sync for VariantFormat
impl Unpin for VariantFormat
impl !UnwindSafe for VariantFormat
Blanket Implementations
Mutably borrows from an owned value. Read more