Trait musli_core::de::MapDecoder
source · pub trait MapDecoder<'de> {
type Cx: ?Sized + Context;
type DecodeEntry<'this>: EntryDecoder<'de, Cx = Self::Cx>
where Self: 'this;
type DecodeRemainingEntries<'this>: EntriesDecoder<'de, Cx = Self::Cx>
where Self: 'this;
// Required methods
fn decode_entry(
&mut self,
) -> Result<Option<Self::DecodeEntry<'_>>, <Self::Cx as Context>::Error>;
fn decode_remaining_entries(
&mut self,
) -> Result<Self::DecodeRemainingEntries<'_>, <Self::Cx as Context>::Error>;
// Provided methods
fn size_hint(&self) -> SizeHint { ... }
fn entry<K, V>(
&mut self,
) -> Result<Option<(K, V)>, <Self::Cx as Context>::Error>
where K: Decode<'de, <Self::Cx as Context>::Mode>,
V: Decode<'de, <Self::Cx as Context>::Mode> { ... }
}Expand description
Trait governing how to decode a sequence of pairs.
Required Associated Types§
sourcetype DecodeEntry<'this>: EntryDecoder<'de, Cx = Self::Cx>
where
Self: 'this
type DecodeEntry<'this>: EntryDecoder<'de, Cx = Self::Cx> where Self: 'this
The decoder to use for a key.
sourcetype DecodeRemainingEntries<'this>: EntriesDecoder<'de, Cx = Self::Cx>
where
Self: 'this
type DecodeRemainingEntries<'this>: EntriesDecoder<'de, Cx = Self::Cx> where Self: 'this
Decoder returned by MapDecoder::decode_remaining_entries.
Required Methods§
sourcefn decode_entry(
&mut self,
) -> Result<Option<Self::DecodeEntry<'_>>, <Self::Cx as Context>::Error>
fn decode_entry( &mut self, ) -> Result<Option<Self::DecodeEntry<'_>>, <Self::Cx as Context>::Error>
Decode the next key. This returns Ok(None) where there are no more
elements to decode.
sourcefn decode_remaining_entries(
&mut self,
) -> Result<Self::DecodeRemainingEntries<'_>, <Self::Cx as Context>::Error>
fn decode_remaining_entries( &mut self, ) -> Result<Self::DecodeRemainingEntries<'_>, <Self::Cx as Context>::Error>
Return simplified decoder for remaining entries.
Provided Methods§
Object Safety§
This trait is not object safe.