Enum serde_reflection::Format[][src]

pub enum Format {
Show 24 variants Variable(Variable<Format>), TypeName(String), Unit, Bool, I8, I16, I32, I64, I128, U8, U16, U32, U64, U128, F32, F64, Char, Str, Bytes, Option(Box<Format>), Seq(Box<Format>), Map { key: Box<Format>, value: Box<Format>, }, Tuple(Vec<Format>), TupleArray { content: Box<Format>, size: usize, },
}
Expand description

Serde-based serialization format for anonymous “value” types.

Variants

Variable(Variable<Format>)

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

TypeName(String)

The name of a container.

Unit
Bool
I8
I16
I32
I64
I128
U8
U16
U32
U64
U128
F32
F64
Char
Str
Bytes
Option(Box<Format>)

The format of Option<T>.

Seq(Box<Format>)

A sequence, e.g. the format of Vec<Foo>.

Map

A map, e.g. the format of BTreeMap<K, V>.

Fields of Map

key: Box<Format>value: Box<Format>
Tuple(Vec<Format>)

A tuple, e.g. the format of (Foo, Bar).

TupleArray

Alias for (Foo, ... Foo). E.g. the format of [Foo; N].

Fields of TupleArray

content: Box<Format>size: usize

Implementations

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

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

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Unify the newly “traced” value format into the current format. Note that there should be no TupleArrays at this point.

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

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.