pub struct Compressor { /* private fields */ }
Expand description

Allows to compress independently multiple blocks of data.

This reduces memory usage compared to calling compress multiple times. The compressed blocks are still completely independent.

Implementations

Creates a new zstd compressor

Creates a new zstd compressor, using the given dictionary.

Compress 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).

A level of 0 uses zstd’s default (currently 3).

Compresses a block of data and returns the compressed result.

A level of 0 uses zstd’s default (currently 3).

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.