Struct fdeflate::Decompressor
source · pub struct Decompressor { /* private fields */ }
Expand description
Decompressor for arbitrary zlib streams.
Implementations§
source§impl Decompressor
impl Decompressor
sourcepub fn ignore_adler32(&mut self)
pub fn ignore_adler32(&mut self)
Ignore the checksum at the end of the stream.
sourcepub fn read(
&mut self,
input: &[u8],
output: &mut [u8],
output_position: usize,
end_of_input: bool,
) -> Result<(usize, usize), DecompressionError>
pub fn read( &mut self, input: &[u8], output: &mut [u8], output_position: usize, end_of_input: bool, ) -> Result<(usize, usize), DecompressionError>
Decompresses a chunk of data.
Returns the number of bytes read from input
and the number of bytes written to output
,
or an error if the deflate stream is not valid. input
is the compressed data. output
is
the buffer to write the decompressed data to, starting at index output_position
.
end_of_input
indicates whether more data may be available in the future.
The contents of output
after output_position
are ignored. However, this function may
write additional data to output
past what is indicated by the return value.
When this function returns Ok
, at least one of the following is true:
- The input is fully consumed.
- The output is full but there are more bytes to output.
- The deflate stream is complete (and
is_done
will return true).
§Panics
This function will panic if output_position
is out of bounds.
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 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