pub trait CborMapDecoder {
// Required methods
fn size(&self) -> Option<usize>;
fn deserialize_key<K>(
&mut self,
) -> Result<Option<K>, CborSerializationError>
where K: CborDeserialize;
fn deserialize_value<V>(&mut self) -> Result<V, CborSerializationError>
where V: CborDeserialize;
fn skip_value(&mut self) -> Result<(), CborSerializationError>;
// Provided method
fn deserialize_entry<K, V>(
&mut self,
) -> Result<Option<(K, V)>, CborSerializationError>
where K: CborDeserialize,
V: CborDeserialize { ... }
}Expand description
Decoder of CBOR map
Required Methods§
Sourcefn size(&self) -> Option<usize>
fn size(&self) -> Option<usize>
Number of entries of the map being decoded (total number of entries, not
remaining). Returns None if the map has indefinite size.
Sourcefn deserialize_key<K>(&mut self) -> Result<Option<K>, CborSerializationError>where
K: CborDeserialize,
fn deserialize_key<K>(&mut self) -> Result<Option<K>, CborSerializationError>where
K: CborDeserialize,
Deserialize an entry key. Returns None if
all entries in the map has been deserialized.
Sourcefn deserialize_value<V>(&mut self) -> Result<V, CborSerializationError>where
V: CborDeserialize,
fn deserialize_value<V>(&mut self) -> Result<V, CborSerializationError>where
V: CborDeserialize,
Deserialize an entry value.
Sourcefn skip_value(&mut self) -> Result<(), CborSerializationError>
fn skip_value(&mut self) -> Result<(), CborSerializationError>
Skips entry value
Provided Methods§
Sourcefn deserialize_entry<K, V>(
&mut self,
) -> Result<Option<(K, V)>, CborSerializationError>where
K: CborDeserialize,
V: CborDeserialize,
fn deserialize_entry<K, V>(
&mut self,
) -> Result<Option<(K, V)>, CborSerializationError>where
K: CborDeserialize,
V: CborDeserialize,
Deserialize an entry consisting of a key and value. Returns None if
all entries in the map has been deserialized.
The total number of entries that can be deserialized is equal
to Self::size.
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.