Skip to main content

Crate linflate

Crate linflate 

Source
Expand description

linflate — Fast pure-Rust DEFLATE decompressor.

Full-buffer, zero-copy, SIMD-optimized. Follows libdeflate’s architecture with zlib-ng’s branchless refill and SIMD match copy, thread-local table pool and segment-aware inflate_segment API.

§Usage

let mut output = vec![0u8; expected_size + linflate::OVERWRITE_HEADROOM];
let written = linflate::inflate_into(compressed, &mut output)?;
output.truncate(written);

Modules§

bitreader
Branchless 64-bit DEFLATE bit reader.
copy
SIMD-accelerated LZ77 match copy.
fastloop
The hot DEFLATE decode loop.
fixed
Pre-built fixed Huffman tables for BTYPE=1 blocks (RFC 1951 §3.2.6).
tables
Huffman table builder with packed u32 entries.

Enums§

InflateError
Errors from the DEFLATE decompressor.

Constants§

OVERWRITE_HEADROOM
Extra bytes of output buffer headroom required for SIMD overwrite. Caller must allocate uncompressed_size + OVERWRITE_HEADROOM.

Functions§

inflate_into
Decompress raw DEFLATE data into a pre-allocated output buffer.
inflate_segment
Decompress a DEFLATE segment that may not end on BFINAL=1.
inflate_segment_with_prefix
Decompress a DEFLATE segment with a prefix window for LZ77 back-reference resolution across segment boundaries.
inflate_segment_with_prefix_limited
Same as inflate_segment_with_prefix but stops after limit output bytes. Used for pass-2 fixup where only the first 32KB needs correction.
inflate_to_vec
Convenience: decompress into a newly allocated Vec.