pub trait EntryDecoder<'de> {
type Cx: Context<Error = Self::Error, Allocator = Self::Allocator>;
type Error;
type Allocator: Allocator;
type Mode: 'static;
type DecodeKey<'this>: Decoder<'de, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode>
where Self: 'this;
type DecodeValue: Decoder<'de, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode>;
// Required methods
fn cx(&self) -> Self::Cx;
fn decode_key(&mut self) -> Result<Self::DecodeKey<'_>, Self::Error>;
fn decode_value(self) -> Result<Self::DecodeValue, Self::Error>;
// Provided method
fn size_hint(&self) -> SizeHint { ... }
}Expand description
Trait governing how to decode a map entry.
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.
Required Methods§
Sourcefn decode_key(&mut self) -> Result<Self::DecodeKey<'_>, Self::Error>
fn decode_key(&mut self) -> Result<Self::DecodeKey<'_>, Self::Error>
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_value(self) -> Result<Self::DecodeValue, Self::Error>
fn decode_value(self) -> Result<Self::DecodeValue, Self::Error>
Decode the second value in the pair..
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".