pub trait EntryEncoder {
type Cx: ?Sized + Context;
type Ok;
type EncodeKey<'this>: Encoder<Cx = Self::Cx, Ok = Self::Ok, Error = <Self::Cx as Context>::Error, Mode = <Self::Cx as Context>::Mode>
where Self: 'this;
type EncodeValue<'this>: Encoder<Cx = Self::Cx, Ok = Self::Ok, Error = <Self::Cx as Context>::Error, Mode = <Self::Cx as Context>::Mode>
where Self: 'this;
// Required methods
fn encode_key(
&mut self,
) -> Result<Self::EncodeKey<'_>, <Self::Cx as Context>::Error>;
fn encode_value(
&mut self,
) -> Result<Self::EncodeValue<'_>, <Self::Cx as Context>::Error>;
fn finish_entry(self) -> Result<Self::Ok, <Self::Cx as Context>::Error>;
// Provided method
fn insert_entry<K, V>(
self,
key: K,
value: V,
) -> Result<Self::Ok, <Self::Cx as Context>::Error>
where Self: Sized,
K: Encode<<Self::Cx as Context>::Mode>,
V: Encode<<Self::Cx as Context>::Mode> { ... }
}
Expand description
Trait governing how to encode a map entry.
Required Associated Types§
Required Methods§
Sourcefn encode_key(
&mut self,
) -> Result<Self::EncodeKey<'_>, <Self::Cx as Context>::Error>
fn encode_key( &mut self, ) -> Result<Self::EncodeKey<'_>, <Self::Cx as Context>::Error>
Return the encoder for the key in the entry.
Sourcefn encode_value(
&mut self,
) -> Result<Self::EncodeValue<'_>, <Self::Cx as Context>::Error>
fn encode_value( &mut self, ) -> Result<Self::EncodeValue<'_>, <Self::Cx as Context>::Error>
Return encoder for value in the entry.
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.