Trait SerializeSeq

Source
pub trait SerializeSeq {
    type Ok;
    type Error: Error;

    // Required methods
    fn serialize_element<V: Serialize>(
        &mut self,
        v: &V,
    ) -> Result<Self::Ok, Self::Error>;
    fn end(self) -> Result<Self::Ok, Self::Error>;
}
Expand description

A trait for serializing a sequence of elements.

Required Associated Types§

Source

type Ok

The type of the value that is returned when serialization is successful.

Source

type Error: Error

The type of the error that is returned when serialization fails.

Required Methods§

Source

fn serialize_element<V: Serialize>( &mut self, v: &V, ) -> Result<Self::Ok, Self::Error>

Serialize an element in the sequence.

Source

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

End the serialization of the sequence.

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.

Implementors§