[][src]Module lzzzz::lz4

Extremely fast compression algorithm.

Acceleration factor

Some functions take the 'acceleration factor' as i32.

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

// The default factor is 1 so both have a 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 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_to_vec

Appends compressed data to Vec<u8>.

decompress

Decompresses a LZ4 block.

decompress_partial

Decompresses a LZ4 block until the destination slice fills up.

decompress_with_dict

Decompresses a LZ4 block with a dictionary.

max_compressed_size

Calculates the maximum size of the compressed output.