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

    // Required methods
    fn serialize_element<T: Serialize + ?Sized>(
        &mut self,
        element: &T
    ) -> Result<(), Self::Error>;
    fn end(self) -> Result<Self::Ok, Self::Error>;
}
Expand description

Returned from Serializer::serialize_array.

This provides a continuation of sorts where you can call serialize_element 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_element<T: Serialize + ?Sized>( &mut self, element: &T ) -> Result<(), Self::Error>

Serialize an array element.

source

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

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

Object Safety§

This trait is not object safe.

Implementors§