pub struct TaggedSerializeViaParent<'ser, 'a, W: Write> {
parent: &'ser mut Serializer<'a, W>,
}Expand description
Stateless pass-through adapter shared by every shape whose only job is
to route element/key/value calls back through the parent
Serializer. The msgpack header (array length or map
length) is written upfront in the corresponding serialize_* method
before the adapter is constructed; from there each entry is just one or
two more values appended to the writer through the wrapper, so any
tagged value nested inside still gets the int-keyed-map treatment.
Used as SerializeSeq (e.g. Vec<T>), SerializeTuple (fixed-length
Rust tuples), and SerializeMap (e.g. BTreeMap<K, V>). Struct shapes
have their own adapter (TaggedSerializeProduct) because they carry
the Product needed to translate field names into
integer tags.
Fields§
§parent: &'ser mut Serializer<'a, W>Trait Implementations§
Source§impl<'ser, 'a, W: Write> SerializeMap for TaggedSerializeViaParent<'ser, 'a, W>
Free-form maps (BTreeMap<K, V> and friends). Both keys and values are
routed through the parent. Routing keys is mostly a no-op for the common
primitive-key case (the wrapper forwards primitives to inner verbatim),
but it keeps the door open for tagged keys without a special case here.
impl<'ser, 'a, W: Write> SerializeMap for TaggedSerializeViaParent<'ser, 'a, W>
Free-form maps (BTreeMap<K, V> and friends). Both keys and values are
routed through the parent. Routing keys is mostly a no-op for the common
primitive-key case (the wrapper forwards primitives to inner verbatim),
but it keeps the door open for tagged keys without a special case here.
Source§impl<'ser, 'a, W: Write> SerializeSeq for TaggedSerializeViaParent<'ser, 'a, W>
Variable-length sequences (Vec<T>, &[T], …). Each element recurses
through the parent so tagged elements stay int-keyed.
impl<'ser, 'a, W: Write> SerializeSeq for TaggedSerializeViaParent<'ser, 'a, W>
Variable-length sequences (Vec<T>, &[T], …). Each element recurses
through the parent so tagged elements stay int-keyed.
Source§impl<'ser, 'a, W: Write> SerializeTuple for TaggedSerializeViaParent<'ser, 'a, W>
Fixed-length Rust tuples ((A, B), (A, B, C), …). Same wire shape as a
sequence — msgpack has one length-prefixed array, regardless of whether
the source was variable- or fixed-length on the Rust side.
impl<'ser, 'a, W: Write> SerializeTuple for TaggedSerializeViaParent<'ser, 'a, W>
Fixed-length Rust tuples ((A, B), (A, B, C), …). Same wire shape as a
sequence — msgpack has one length-prefixed array, regardless of whether
the source was variable- or fixed-length on the Rust side.