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§
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.