pub struct Decoder<'a, T> { /* private fields */ }Expand description
Implementations§
Source§impl<'a, T> Decoder<'a, T>
impl<'a, T> Decoder<'a, T>
Sourcepub fn decode(&mut self, tokens: impl Iterator<Item = u32>) -> Option<T>
pub fn decode(&mut self, tokens: impl Iterator<Item = u32>) -> Option<T>
Decodes one symbol, pulling additional tokens from tokens as needed.
Returns None when the token stream is exhausted.
Sourcepub fn decode_all(
&mut self,
tokens: impl Iterator<Item = u32>,
extend: &mut impl Extend<T>,
)
pub fn decode_all( &mut self, tokens: impl Iterator<Item = u32>, extend: &mut impl Extend<T>, )
Decodes all remaining symbols from tokens and appends them to extend.
Sourcepub fn finish(&self) -> Result<(), DecodeError>
pub fn finish(&self) -> Result<(), DecodeError>
Verifies that the decoder ended in the expected final state.
Returns Err(DecodeError::Incomplete) if the internal state does not
match the encoder’s initial state, which typically indicates corrupted data.
Auto Trait Implementations§
impl<'a, T> Freeze for Decoder<'a, T>
impl<'a, T> RefUnwindSafe for Decoder<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Decoder<'a, T>where
T: Sync,
impl<'a, T> Sync for Decoder<'a, T>where
T: Sync,
impl<'a, T> Unpin for Decoder<'a, T>
impl<'a, T> UnsafeUnpin for Decoder<'a, T>
impl<'a, T> UnwindSafe for Decoder<'a, T>where
T: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more