Struct rmp_serde::encode::MaybeUnknownLengthCompound [−][src]
pub struct MaybeUnknownLengthCompound<'a, W: 'a, C: 'a> { /* fields omitted */ }
Expand description
Contains a Serializer
for encoding elements of sequences and maps.
Note
If , for example, a field inside a struct is tagged with #serde(flatten)
the total number of
fields of this struct will be unknown to serde because flattened fields may have name clashes
and then will be overwritten. So, serde wants to serialize the struct as a map with an unknown
length.
For the described case a UnknownLengthCompound
is used to encode the elements. On end()
the counted length and the encoded elements will be written to the Serializer
. A caveat is,
that structs that contain flattened fields arem always written as a map, even when compact
representaion is desired.
Otherwise, if the length is known, the elements will be encoded directly by the Serializer
.
Trait Implementations
impl<'a, W: Write + 'a, C: SerializerConfig> SerializeMap for MaybeUnknownLengthCompound<'a, W, C>
[src]
impl<'a, W: Write + 'a, C: SerializerConfig> SerializeMap for MaybeUnknownLengthCompound<'a, W, C>
[src]impl<'a, W: Write + 'a, C: SerializerConfig> SerializeSeq for MaybeUnknownLengthCompound<'a, W, C>
[src]
impl<'a, W: Write + 'a, C: SerializerConfig> SerializeSeq for MaybeUnknownLengthCompound<'a, W, C>
[src]Serialize a sequence element.
Auto Trait Implementations
impl<'a, W, C> RefUnwindSafe for MaybeUnknownLengthCompound<'a, W, C> where
C: RefUnwindSafe,
W: RefUnwindSafe,
impl<'a, W, C> Send for MaybeUnknownLengthCompound<'a, W, C> where
C: Send,
W: Send,
impl<'a, W, C> Sync for MaybeUnknownLengthCompound<'a, W, C> where
C: Sync,
W: Sync,
impl<'a, W, C> Unpin for MaybeUnknownLengthCompound<'a, W, C> where
C: Unpin,
impl<'a, W, C> !UnwindSafe for MaybeUnknownLengthCompound<'a, W, C>