pub trait SequenceEncoder {
type Cx: ?Sized + Context;
type Ok;
type EncodeNext<'this>: Encoder<Cx = Self::Cx, Ok = Self::Ok, Error = <Self::Cx as Context>::Error, Mode = <Self::Cx as Context>::Mode>
where Self: 'this;
// Required methods
fn encode_next(
&mut self,
) -> Result<Self::EncodeNext<'_>, <Self::Cx as Context>::Error>;
fn finish_sequence(self) -> Result<Self::Ok, <Self::Cx as Context>::Error>;
// Provided method
fn push<T>(&mut self, value: T) -> Result<(), <Self::Cx as Context>::Error>
where T: Encode<<Self::Cx as Context>::Mode> { ... }
}
Expand description
Trait governing how to encode a sequence.
Required Associated Types§
Required Methods§
Sourcefn encode_next(
&mut self,
) -> Result<Self::EncodeNext<'_>, <Self::Cx as Context>::Error>
fn encode_next( &mut self, ) -> Result<Self::EncodeNext<'_>, <Self::Cx as Context>::Error>
Return encoder for the next element.
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.