pub trait SequenceDecoder<'de> {
type Cx: ?Sized + Context;
type DecodeNext<'this>: Decoder<'de, Cx = Self::Cx, Error = <Self::Cx as Context>::Error, Mode = <Self::Cx as Context>::Mode>
where Self: 'this;
// Required methods
fn decode_next(
&mut self,
) -> Result<Self::DecodeNext<'_>, <Self::Cx as Context>::Error>;
fn try_decode_next(
&mut self,
) -> Result<Option<Self::DecodeNext<'_>>, <Self::Cx as Context>::Error>;
// Provided methods
fn size_hint(&self) -> SizeHint { ... }
fn next<T>(&mut self) -> Result<T, <Self::Cx as Context>::Error>
where T: Decode<'de, <Self::Cx as Context>::Mode> { ... }
fn try_next<T>(&mut self) -> Result<Option<T>, <Self::Cx as Context>::Error>
where T: Decode<'de, <Self::Cx as Context>::Mode> { ... }
}
Expand description
Trait governing how to decode a sequence.
Required Associated Types§
Required Methods§
Sourcefn decode_next(
&mut self,
) -> Result<Self::DecodeNext<'_>, <Self::Cx as Context>::Error>
fn decode_next( &mut self, ) -> Result<Self::DecodeNext<'_>, <Self::Cx as Context>::Error>
Return decoder to decode the next element.
This will error or provide garbled data in case the next element is not available.
Sourcefn try_decode_next(
&mut self,
) -> Result<Option<Self::DecodeNext<'_>>, <Self::Cx as Context>::Error>
fn try_decode_next( &mut self, ) -> Result<Option<Self::DecodeNext<'_>>, <Self::Cx as Context>::Error>
Try to decode 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.