pub struct Decompressor<'a> { /* private fields */ }
Expand description

Allows to decompress independently multiple blocks of data.

This reduces memory usage compared to calling decompress multiple times.

Implementations

Creates a new zstd decompressor.

Creates a new zstd decompressor, using the given dictionary.

Creates a new decompressor using an existing DecoderDictionary.

Note that using a dictionary means that compression will need to use the same dictionary.

Changes the dictionary used by this decompressor.

Will affect future compression jobs.

Note that using a dictionary means that compression will need to use the same dictionary.

Changes the dictionary used by this decompressor.

Note that using a dictionary means that compression will need to use the same dictionary.

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

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.

Sets a decompression parameter for this decompressor.

Sets the maximum back-reference distance.

The actual maximum distance is going to be 2^log_distance.

This will need to at least match the value set when compressing.

This is supported on crate feature experimental only.

Enables or disabled expecting the 4-byte magic header

Only available with the experimental feature.

This will need to match the settings used when compressing.

Get an upper bound on the decompressed size of data, if available

This can be used to pre-allocate enough capacity for decompress_to_buffer and is used by decompress to ensure that it does not over-allocate if you supply a large capacity.

Will return None if the upper bound cannot be determined or is larger than usize::MAX

Note that unless the experimental feature is enabled, this will always return None.

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

Performs the conversion.

Performs the conversion.

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.