pub trait MapEncoder {
type Cx: ?Sized + Context;
type Ok;
type EncodeEntry<'this>: EntryEncoder<Cx = Self::Cx, Ok = Self::Ok>
where Self: 'this;
// Required methods
fn encode_entry(
&mut self,
) -> Result<Self::EncodeEntry<'_>, <Self::Cx as Context>::Error>;
fn finish_map(self) -> Result<Self::Ok, <Self::Cx as Context>::Error>;
// Provided methods
fn encode_entry_fn<F>(
&mut self,
f: F,
) -> Result<Self::Ok, <Self::Cx as Context>::Error>
where F: FnOnce(&mut Self::EncodeEntry<'_>) -> Result<(), <Self::Cx as Context>::Error> { ... }
fn insert_entry<F, S>(
&mut self,
key: F,
value: S,
) -> Result<(), <Self::Cx as Context>::Error>
where Self: Sized,
F: Encode<<Self::Cx as Context>::Mode>,
S: Encode<<Self::Cx as Context>::Mode> { ... }
}
Expand description
Encoder for a map.
Required Associated Types§
Sourcetype EncodeEntry<'this>: EntryEncoder<Cx = Self::Cx, Ok = Self::Ok>
where
Self: 'this
type EncodeEntry<'this>: EntryEncoder<Cx = Self::Cx, Ok = Self::Ok> where Self: 'this
Encode the next pair.
Required Methods§
Sourcefn encode_entry(
&mut self,
) -> Result<Self::EncodeEntry<'_>, <Self::Cx as Context>::Error>
fn encode_entry( &mut self, ) -> Result<Self::EncodeEntry<'_>, <Self::Cx as Context>::Error>
Encode the next pair.
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.