pub trait SerializeMap {
    type Ok;
    type Error: Error;

    // Required methods
    fn serialize_entry<K: Serialize + ?Sized, V: Serialize + ?Sized>(
        &mut self,
        key: &K,
        value: &V
    ) -> Result<(), Self::Error>;
    fn end(self) -> Result<Self::Ok, Self::Error>;
}
Expand description

Returned from Serializer::serialize_map.

This provides a continuation of sorts where you can call serialize_entry however many times and then finally the end is reached.

Required Associated Types§

source

type Ok

Must match the Ok type of any Serializer that uses this type.

source

type Error: Error

Must match the Error type of any Serializer that uses this type.

Required Methods§

source

fn serialize_entry<K: Serialize + ?Sized, V: Serialize + ?Sized>( &mut self, key: &K, value: &V ) -> Result<(), Self::Error>

Serialize a map entry given by its key and value.

source

fn end(self) -> Result<Self::Ok, Self::Error>

Consumes and finalizes the map serializer returning the Self::Ok data.

Object Safety§

This trait is not object safe.

Implementors§