pub trait MapDecoder<'de> {
type Cx: Context<Error = Self::Error, Allocator = Self::Allocator>;
type Error;
type Allocator: Allocator;
type Mode: 'static;
type DecodeEntry<'this>: EntryDecoder<'de, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode>
where Self: 'this;
type DecodeRemainingEntries<'this>: EntriesDecoder<'de, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode>
where Self: 'this;
// Required methods
fn cx(&self) -> Self::Cx;
fn decode_entry(
&mut self,
) -> Result<Option<Self::DecodeEntry<'_>>, Self::Error>;
fn decode_remaining_entries(
&mut self,
) -> Result<Self::DecodeRemainingEntries<'_>, Self::Error>;
// Provided methods
fn size_hint(&self) -> SizeHint { ... }
fn entry<K, V>(&mut self) -> Result<Option<(K, V)>, Self::Error>
where K: Decode<'de, Self::Mode, Self::Allocator>,
V: Decode<'de, Self::Mode, Self::Allocator> { ... }
}Expand description
Trait governing how to decode a sequence of pairs.
Required Associated Types§
Sourcetype Cx: Context<Error = Self::Error, Allocator = Self::Allocator>
type Cx: Context<Error = Self::Error, Allocator = Self::Allocator>
Context associated with the decoder.
Sourcetype DecodeEntry<'this>: EntryDecoder<'de, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode>
where
Self: 'this
type DecodeEntry<'this>: EntryDecoder<'de, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode> where Self: 'this
The decoder to use for a key.
Sourcetype DecodeRemainingEntries<'this>: EntriesDecoder<'de, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode>
where
Self: 'this
type DecodeRemainingEntries<'this>: EntriesDecoder<'de, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode> where Self: 'this
Decoder returned by MapDecoder::decode_remaining_entries.
Required Methods§
Sourcefn decode_entry(&mut self) -> Result<Option<Self::DecodeEntry<'_>>, Self::Error>
fn decode_entry(&mut self) -> Result<Option<Self::DecodeEntry<'_>>, Self::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::Error>
fn decode_remaining_entries( &mut self, ) -> Result<Self::DecodeRemainingEntries<'_>, Self::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".