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.