pub struct Decoder<'a> { /* private fields */ }Implementations§
Source§impl<'a> Decoder<'a>
impl<'a> Decoder<'a>
Sourcepub fn new(buffers: DecoderBuffers<'a>) -> Result<Self, DecodeError>
pub fn new(buffers: DecoderBuffers<'a>) -> Result<Self, DecodeError>
Create a decoder with every validation check enabled.
Returns DecodeError::InvalidEntropyTable if entropy storage is too short.
Sourcepub fn with_options(
buffers: DecoderBuffers<'a>,
options: DecoderOptions,
) -> Result<Self, DecodeError>
pub fn with_options( buffers: DecoderBuffers<'a>, options: DecoderOptions, ) -> Result<Self, DecodeError>
Create a decoder with explicit DecoderOptions.
Returns DecodeError::InvalidEntropyTable if entropy storage is too short.
pub fn decode<'decoder>( &'decoder mut self, input: &[u8], ) -> Result<DecodeStep<'decoder>, DecodeError>
Sourcepub fn push<E>(
&mut self,
input: &[u8],
output: impl FnMut(&[u8]) -> Result<(), E>,
) -> Result<(), StreamError<E>>
pub fn push<E>( &mut self, input: &[u8], output: impl FnMut(&[u8]) -> Result<(), E>, ) -> Result<(), StreamError<E>>
Consumes an input fragment and sends decoded bytes to output.
This is the convenient callback-driven counterpart to decode.
Frame events are handled internally while output errors remain distinct
from compressed-stream errors.
Sourcepub fn finish_with<E>(
&mut self,
output: impl FnMut(&[u8]) -> Result<(), E>,
) -> Result<(), StreamError<E>>
pub fn finish_with<E>( &mut self, output: impl FnMut(&[u8]) -> Result<(), E>, ) -> Result<(), StreamError<E>>
Drains buffered output and validates the end of the stream.
pub fn finish(&self) -> Result<(), DecodeError>
pub fn reset(&mut self)
Auto Trait Implementations§
impl<'a> !UnwindSafe for Decoder<'a>
impl<'a> Freeze for Decoder<'a>
impl<'a> RefUnwindSafe for Decoder<'a>
impl<'a> Send for Decoder<'a>
impl<'a> Sync for Decoder<'a>
impl<'a> Unpin for Decoder<'a>
impl<'a> UnsafeUnpin for Decoder<'a>
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