EncodeSeq

Trait EncodeSeq 

Source
pub trait EncodeSeq<'en> {
    type Ok: Stream + Send + Unpin + 'en;
    type Error: Error + Send + Unpin + 'en;

    // Required methods
    fn encode_element<V: IntoStream<'en> + 'en>(
        &mut self,
        value: V,
    ) -> Result<(), Self::Error>;
    fn end(self) -> Result<Self::Ok, Self::Error>;
}
Expand description

Returned from Encoder::encode_seq.

Required Associated Types§

Source

type Ok: Stream + Send + Unpin + 'en

Must match the Ok type of the parent Encoder.

Source

type Error: Error + Send + Unpin + 'en

Must match the Error type of the parent Encoder.

Required Methods§

Source

fn encode_element<V: IntoStream<'en> + 'en>( &mut self, value: V, ) -> Result<(), Self::Error>

Encode the next element in the sequence.

Source

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

Finish encoding 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§