pub enum Chunk<'a> {
    Null,
    Bool(bool),
    Str(Cow<'a, str>),
    Bytes(Cow<'a, [u8]>),
    U64(u64),
    I64(i64),
    F64(f64),
    Struct(Box<dyn StructEmitter + 'a>),
    Map(Box<dyn MapEmitter + 'a>),
    Seq(Box<dyn SeqEmitter + 'a>),
}
Expand description

A chunk represents the minimum state necessary to serialize a value.

Chunks are of two types: atomic primitives and stateful emitters. For instance Chunk::Bool(true) is an atomic primitive. It can be emitted to a serializer directly. On the other hand a Chunk::Map contains a stateful emitter that keeps yielding values until it’s done walking over the map.

Variants

Null

Bool(bool)

Str(Cow<'a, str>)

Bytes(Cow<'a, [u8]>)

U64(u64)

I64(i64)

F64(f64)

Struct(Box<dyn StructEmitter + 'a>)

Map(Box<dyn MapEmitter + 'a>)

Seq(Box<dyn SeqEmitter + 'a>)

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 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.