Expand description
compcol — a collection of pure-Rust, no_std, 100% safe compression
algorithms behind a uniform streaming trait.
Each algorithm sits behind its own Cargo feature so downstream crates
only pay for what they use. An optional factory module provides
runtime by-name lookup when the factory (and thus alloc) feature is
enabled.
See Encoder, Decoder, and Algorithm for the contract every
algorithm in this crate implements.
Modules§
- adc
adc - ADC (Apple Data Compression).
- amiga_
lzx amiga_lzx - Amiga LZX — the original 1995 Jonathan Forbes LZX codec used by the
Amiga
.lzxarchive format. - arc_
crunch arc_crunch - ARC “Crunch” — System Enhancement Associates ARC archiver method 8.
- arc_
squash arc_squash - ARC “Squashed” — System Enhancement Associates ARC archiver method 9.
- arc_
squeeze arc_squeeze - ARC “Squeeze” — the CP/M
SQ/USQcodec, ARC method 4. - arsenic
arsenic - StuffIt 5 Arsenic (compression method 15) — decoder only.
- bcj
bcj - BCJ branch-converter filters (from the public-domain LZMA SDK lineage, as used by xz).
- bcj2
bcj2 - BCJ2 — the 4-stream x86 branch-conversion filter (7-Zip filter id
0303011B), from the public-domain LZMA SDK. - brotli
brotli - Brotli (RFC 7932) — partial-but-functional implementation.
- bwt
bwt - Burrows–Wheeler Transform (BWT) — a standalone, reversible block codec.
- bzip2
bzip2 - bzip2 (
.bz2). - deflate
deflate - RFC 1951 deflate.
- deflate64
deflate64 - PKWARE deflate64 (zip method 9).
- delta
delta - Delta filter — byte-wise delta coding with a configurable distance.
- factory
factory - Runtime by-name lookup of algorithms.
- gzip
gzip - RFC 1952 gzip container around RFC 1951 deflate.
- hpack
hpack - HTTP/2 HPACK header compression — RFC 7541.
- huffman_
codec huffman - Standalone canonical (order-0) Huffman codec.
- io
std std::io::Read/std::io::Writeadapters around anyEncoder/Decoder.- lha
lha - LHA / LZH compression methods:
-lh1-,-lh2-,-lh4-,-lh5-,-lh6-,-lh7-. - limit
- Decompression-bomb defenses.
- lz4
lz4 - LZ4 block format with a tiny multi-block framing for streaming.
- lz5
lz5 - LZ5 / Lizard frame-format codec.
- lzah
lzah - StuffIt classic compression method 5 (“LZAH”): LZSS sliding window over a pre-seeded 4 KiB dictionary, with a single adaptive (sibling- property) Huffman tree for literal/length tokens and a static canonical prefix code for the high bits of each match offset.
- lzfse
lzfse - LZFSE (Apple’s LZ77 + Finite State Entropy) — decoder only.
- lzham
lzham - LZHAM (Lossless ZIP Huffman Arithmetic Modeling) — header parser only.
- lzma
lzma - LZMA (Lempel–Ziv–Markov chain Algorithm).
- lzma2
lzma2 - Raw LZMA2 decoder (7-Zip coder id
21). - lznt1
lznt1 - LZNT1 — NTFS native file compression.
- lzo
lzo - LZO1X-1 (Lempel–Ziv–Oberhumer) with a tiny multi-block framing for streaming.
- lzs
lzs - Stac LZS (Lempel–Ziv–Stac) — the LZ77 variant specified by RFC 1974 (PPP Stac LZS Compression Protocol).
- lzss
lzss - LZSS (Storer–Szymanski LZ77 variant) — Okumura’s reference layout.
- lzw
lzw - Lempel–Ziv–Welch — the Unix
compress(1)(.Z) flavour. - lzx
amiga_lzxorlzx - LZX (Microsoft CAB / WIM compression).
- mtf
mtf - Move-To-Front (MTF) transform — a reversible, length-preserving filter.
- packbits
packbits - PackBits — Apple’s tag-byte RLE used in TIFF, PSD, BMP, and macOS metadata.
- ppmd
ppmd - PPMd — Dmitry Shkarin’s PPMII variant H, the format used by 7-Zip
(method
PPMd), RAR3+ (PPM block mode), and ZIP method 98. - qpack
qpack - HTTP/3 QPACK header compression — RFC 9204.
- quantum
quantum - Quantum (Stac, used in older Microsoft CAB files) — decoder only.
- rangecoder
rangecoder - Adaptive order-0 binary range coder — a standalone entropy codec.
- rar1
rar1 - RAR 1.x (1995-1996) — building-block library, no end-to-end decoder.
- rar2
rar2 - RAR 2.x (1997-2002) — reverse-engineered — decoder-only.
- rar3
rar3 - RAR 3.x (2002-2013) — LZ77 + Huffman path — decoder only.
- rar5
rar5 - RAR 5.x (2013-present) — LZ77/Huffman + new filters — decoder only.
- rle
rle - Run-length encoding.
- rle90
rle90 - RLE90 — the
0x90/DLE run-length variant shared by ARC method 3 (“packed”) and classic StuffIt method 1. - sit13
sit13 - StuffIt classic compression method 13 (“LZ+Huffman”).
- snappy
snappy - Google Snappy — raw block format.
- tokio_
io tokio - Async
tokio::io::AsyncRead/AsyncWriteadapters. - vec
alloc - One-shot
Vec<u8>compress / decompress helpers. - xpress
xpress - Microsoft Xpress — Plain LZ77 byte-aligned codec.
- xpress_
huffman xpress_huffman - XPress Huffman ([MS-XCA] §2.1) — Microsoft’s LZ77 + canonical Huffman.
- xz
xz - xz container around LZMA2.
- zip_
implode zip_implode - PKZIP Implode (ZIP method 6) — decoder only.
- zip_
reduce zip_reduce - PKZip Reduce (methods 2–5) — decoder only.
- zip_
shrink zip_shrink - ZIP method 1 — Shrink: dynamic LZW with a partial-clear marker.
- zlib
zlib - RFC 1950 zlib container around RFC 1951 deflate.
- zstd
zstd - Zstandard (RFC 8478) — partial implementation.
Structs§
- Progress
- Bytes consumed from
inputand written tooutputby one codec call.
Enums§
- Error
- Errors that any algorithm in this crate may return.
- Flush
- How aggressively
Encoder::flushshould drain pending encoder state. - Status
- Why a codec call returned — the explicit “what should I do next?” signal.