pub trait SequenceDecoder<'de> {
type Cx: Context<Error = Self::Error, Allocator = Self::Allocator>;
type Error;
type Allocator: Allocator;
type Mode: 'static;
type DecodeNext<'this>: Decoder<'de, Cx = Self::Cx, Error = Self::Error, Allocator = Self::Allocator, Mode = Self::Mode>
where Self: 'this;
// Required methods
fn cx(&self) -> Self::Cx;
fn decode_next(&mut self) -> Result<Self::DecodeNext<'_>, Self::Error>;
fn try_decode_next(
&mut self,
) -> Result<Option<Self::DecodeNext<'_>>, Self::Error>;
// Provided methods
fn size_hint(&self) -> SizeHint { ... }
fn next<T>(&mut self) -> Result<T, Self::Error>
where T: Decode<'de, Self::Mode, Self::Allocator> { ... }
fn try_next<T>(&mut self) -> Result<Option<T>, Self::Error>
where T: Decode<'de, Self::Mode, Self::Allocator> { ... }
}Expand description
Trait governing how to decode a sequence.
Required Associated Types§
Required Methods§
Sourcefn decode_next(&mut self) -> Result<Self::DecodeNext<'_>, Self::Error>
fn decode_next(&mut self) -> Result<Self::DecodeNext<'_>, Self::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::Error>
fn try_decode_next( &mut self, ) -> Result<Option<Self::DecodeNext<'_>>, Self::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".