CborMapEncoder

Trait CborMapEncoder 

Source
pub trait CborMapEncoder {
    // Required methods
    fn serialize_entry<K, V>(
        &mut self,
        key: &K,
        value: &V,
    ) -> Result<(), CborSerializationError>
       where K: CborSerialize + ?Sized,
             V: CborSerialize + ?Sized;
    fn end(self) -> Result<(), CborSerializationError>;
}
Expand description

Encoder of CBOR map

Required Methods§

Source

fn serialize_entry<K, V>( &mut self, key: &K, value: &V, ) -> Result<(), CborSerializationError>

Serialize an entry consisting of a key and value and add it to the map (appended to current list of entries). The number of entries added to the map must equal the size given to CborEncoder::encode_map When all entries have been serialized, Self::end must be called.

Source

fn end(self) -> Result<(), CborSerializationError>

End map serialization.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§