Module lz4

Source
Expand description

LZ4 compression and decompression.

LZ4: Extremely fast compression algorithm.

§Acceleration factor

Some functions take the acceleration factor.

Larger value increases the processing speed in exchange for the lesser compression ratio.

// The default factor is 1 so both have the same meaning.
lz4::compress_to_vec(data, &mut buf, lz4::ACC_LEVEL_DEFAULT)?;
lz4::compress_to_vec(data, &mut buf, 1)?;

// Factors lower than 1 are interpreted as 1 so these are also the same as above.
lz4::compress_to_vec(data, &mut buf, 0)?;
lz4::compress_to_vec(data, &mut buf, -100)?;

// Faster but less effective compression.
lz4::compress_to_vec(data, &mut buf, 1000)?;

Structs§

Compressor
Streaming LZ4 compressor.
Decompressor
Streaming LZ4 decompressor.

Constants§

ACC_LEVEL_DEFAULT
Predefined acceleration level (1).

Functions§

compress
Performs LZ4 block compression.
compress_fill
Compress data to fill dst.
compress_to_vec
Appends compressed data to Vec<u8>.
decompress
Decompresses an LZ4 block.
decompress_partial
Decompresses an LZ4 block until the destination slice fills up.
decompress_partial_with_dict
Decompresses an LZ4 block with a dictionary until the destination slice fills up.
decompress_with_dict
Decompresses an LZ4 block with a dictionary.
max_compressed_size
Calculates the maximum size of the compressed output.