pub trait EntriesDecoder<'de> {
type Cx: ?Sized + Context;
type DecodeEntryKey<'this>: Decoder<'de, Cx = Self::Cx, Error = <Self::Cx as Context>::Error, Mode = <Self::Cx as Context>::Mode>
where Self: 'this;
type DecodeEntryValue<'this>: Decoder<'de, Cx = Self::Cx, Error = <Self::Cx as Context>::Error, Mode = <Self::Cx as Context>::Mode>
where Self: 'this;
// Required methods
fn decode_entry_key(
&mut self,
) -> Result<Option<Self::DecodeEntryKey<'_>>, <Self::Cx as Context>::Error>;
fn decode_entry_value(
&mut self,
) -> Result<Self::DecodeEntryValue<'_>, <Self::Cx as Context>::Error>;
fn end_entries(self) -> Result<(), <Self::Cx as Context>::Error>;
// Provided method
fn size_hint(&self) -> SizeHint { ... }
}
Expand description
Trait governing how to decode a sequence of map pairs.
This trait exists so that decoders can implement a mode that is compatible with serde deserialization.
If you do not intend to implement this, then serde compatibility for your format might be degraded.
Required Associated Types§
Required Methods§
Sourcefn decode_entry_key(
&mut self,
) -> Result<Option<Self::DecodeEntryKey<'_>>, <Self::Cx as Context>::Error>
fn decode_entry_key( &mut self, ) -> Result<Option<Self::DecodeEntryKey<'_>>, <Self::Cx as Context>::Error>
Try to return the decoder for the first value in the pair.
If this is a map the first value would be the key of the map, if this is a struct the first value would be the field of the struct.
Sourcefn decode_entry_value(
&mut self,
) -> Result<Self::DecodeEntryValue<'_>, <Self::Cx as Context>::Error>
fn decode_entry_value( &mut self, ) -> Result<Self::DecodeEntryValue<'_>, <Self::Cx as Context>::Error>
Decode the value in the map.
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.