pub struct Decompressor { /* private fields */ }Expand description
Reusable decompression context. Holds no configuration: every call states its limit.
Implementations§
Source§impl Decompressor
impl Decompressor
Sourcepub fn new() -> Decompressor
pub fn new() -> Decompressor
Creates a decompression context (its predefined tables are built here).
Sourcepub fn decompress(
&mut self,
src: &[u8],
dict: Option<&DecoderDictionary>,
max_output: usize,
out: &mut Vec<u8>,
) -> Result<usize>
pub fn decompress( &mut self, src: &[u8], dict: Option<&DecoderDictionary>, max_output: usize, out: &mut Vec<u8>, ) -> Result<usize>
Decodes every frame in src (skipping skippable frames), appending to out.
Fails with OutputLimit before out would grow past max_output bytes in total.
Returns the number of bytes appended. Like the reference, empty input is zero frames.
Sourcepub fn decompress_format(
&mut self,
format: FrameFormat,
src: &[u8],
dict: Option<&DecoderDictionary>,
max_output: usize,
out: &mut Vec<u8>,
) -> Result<usize>
pub fn decompress_format( &mut self, format: FrameFormat, src: &[u8], dict: Option<&DecoderDictionary>, max_output: usize, out: &mut Vec<u8>, ) -> Result<usize>
Like Decompressor::decompress for frames in format (magicless frames
are concatenated without magic numbers and cannot include skippable frames).
Sourcepub fn decompress_frame(
&mut self,
src: &[u8],
dict: Option<&DecoderDictionary>,
limit: usize,
out: &mut Vec<u8>,
) -> Result<usize>
pub fn decompress_frame( &mut self, src: &[u8], dict: Option<&DecoderDictionary>, limit: usize, out: &mut Vec<u8>, ) -> Result<usize>
Decodes one frame (or skips one skippable frame) at the start of src,
appending to out without letting it exceed limit bytes. Returns bytes consumed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Decompressor
impl RefUnwindSafe for Decompressor
impl Send for Decompressor
impl Sync for Decompressor
impl Unpin for Decompressor
impl UnsafeUnpin for Decompressor
impl UnwindSafe for Decompressor
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