Struct Decompress

pub struct Decompress { /* private fields */ }

Representation of an in-memory decompression stream.

An instance of Decompress can be used to decompress a stream of bz2-encoded data.

Implementations

impl Decompress

fn new(small: bool) -> Self

Creates a new stream prepared for decompression.

If small is true, then the library will use an alternative decompression algorithm which uses less memory but at the cost of decompressing more slowly (roughly speaking, half the speed, but the maximum memory requirement drops to around 2300k).

fn decompress(&mut self, input: &[u8], output: &mut [u8]) -> Result<Status, Error>

Decompress a block of input into a block of output.

fn decompress_uninit(&mut self, input: &[u8], output: &mut [MaybeUninit<u8>]) -> Result<Status, Error>

Same as Self::decompress but accepts an uninitialized buffer.

fn decompress_vec(&mut self, input: &[u8], output: &mut Vec<u8>) -> Result<Status, Error>

Decompress a block of input into an output vector.

This function will not grow output, but it will fill the space after its current length up to its capacity. The length of the vector will be adjusted appropriately.

fn total_in(&self) -> u64

Total number of bytes processed as input

fn total_out(&self) -> u64

Total number of bytes processed as output

Auto Trait Implementations

impl Freeze for Decompress

impl RefUnwindSafe for Decompress

impl Send for Decompress

impl Sync for Decompress

impl Unpin for Decompress

impl UnsafeUnpin for Decompress

impl UnwindSafe for Decompress

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for Decompress

fn from(t: T) -> T

Returns the argument unchanged.

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

fn into(self) -> U

Calls U::from(self).

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

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

type Error = never;
fn try_from(value: U) -> Result<T, never>

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

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