use crate::Context;
use super::{Decode, Decoder};
pub trait PackDecoder<'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;
#[must_use = "Decoders must be consumed"]
fn decode_next(&mut self) -> Result<Self::DecodeNext<'_>, <Self::Cx as Context>::Error>;
#[inline]
fn next<T>(&mut self) -> Result<T, <Self::Cx as Context>::Error>
where
Self: Sized,
T: Decode<'de, <Self::Cx as Context>::Mode>,
{
self.decode_next()?.decode()
}
}