Struct zstd::block::Decompressor [−][src]
Allows to decompress independently multiple blocks of data.
This reduces memory usage compared to calling decompress
multiple times.
Implementations
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]
&mut self,
source: &[u8],
destination: &mut [u8]
) -> Result<usize>
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]
fn default() -> Decompressor
[src]
Auto Trait Implementations
impl RefUnwindSafe for Decompressor
impl Send for Decompressor
impl !Sync for Decompressor
impl Unpin for Decompressor
impl UnwindSafe for Decompressor
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,