[][src]Struct zstd::block::Decompressor

pub struct Decompressor { /* fields omitted */ }

Allows to decompress independently multiple blocks of data.

This reduces memory usage compared to calling decompress multiple times.

Methods

impl Decompressor[src]

pub fn new() -> Self[src]

Creates a new zstd decompressor.

pub fn with_dict(dict: Vec<u8>) -> Self[src]

Creates a new zstd decompressor, using the given dictionary.

pub fn decompress_to_buffer(
    &mut self,
    source: &[u8],
    destination: &mut [u8]
) -> Result<usize>
[src]

Deompress a single block of data to the given destination buffer.

Returns the number of bytes written, or an error if something happened (for instance if the destination buffer was too small).

pub fn decompress(&mut self, data: &[u8], capacity: usize) -> Result<Vec<u8>>[src]

Decompress a block of data, and return the result in a Vec<u8>.

The decompressed data should be less than capacity bytes, or an error will be returned.

Trait Implementations

impl Default for Decompressor[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]