Struct inflate::InflateStream

source ·
pub struct InflateStream { /* private fields */ }

Implementations§

source§

impl InflateStream

source

pub fn new() -> InflateStream

Create a new stream for decoding raw deflate encoded data.

source

pub fn from_zlib() -> InflateStream

Create a new stream for decoding deflate encoded data with a zlib header and footer

source

pub fn from_zlib_no_checksum() -> InflateStream

Create a new stream for decoding deflate encoded data with a zlib header and footer

This version creates a decoder that does not checksum the data to validate it with the checksum provided with the zlib wrapper.

source

pub fn reset(&mut self)

source

pub fn reset_to_zlib(&mut self)

source

pub fn update<'a>( &'a mut self, data: &[u8] ) -> Result<(usize, &'a [u8]), String>

Try to uncompress/decode the data in data.

On success, returns how many bytes of the input data was decompressed, and a reference to the buffer containing the decompressed data.

This function may not uncompress all the provided data in one call, so it has to be called repeatedly with the data that hasn’t been decompressed yet as an input until the number of bytes decoded returned is 0. (See the top level crate documentation for an example.)

§Errors

If invalid input data is encountered, a string describing what went wrong is returned.

source

pub fn current_checksum(&self) -> u32

Returns the calculated checksum value of the currently decoded data.

Will return 0 for cases where the checksum is not validated.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.