1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
[]
= "compcol"
= "0.4.1"
= "2024"
# Edition 2024 stabilised in Rust 1.85. Code uses `let chains` (Rust 1.88)
# inside the brotli encoder and the io adapters, so 1.88 is the real floor.
= "1.88"
= "A no_std collection of compression algorithms behind a uniform streaming trait, gated per-algorithm by Cargo features."
= "MIT"
= "https://github.com/KarpelesLab/compcol"
= "https://docs.rs/compcol"
= "README.md"
= ["compression", "no_std", "embedded"]
= ["compression", "no-std"]
# Tell docs.rs to build the doc set with every feature on. Without this
# the rendered docs only show the default-feature surface (rle/deflate/
# zlib/gzip/factory) — two thirds of the crate's public API would be
# invisible to anyone reading docs.rs.
[]
= true
= ["--cfg", "docsrs"]
[]
= ["alloc", "rle", "deflate", "zlib", "gzip", "factory"]
# Convenience meta-feature: every algorithm compiled in. Equivalent to
# `cargo build --all-features` at the CLI level; useful in downstream
# Cargo.toml entries (`features = ["all"]`) instead of a 20-item list.
= [
"alloc", "std", "tokio", "factory",
"rle", "deflate", "zlib", "gzip",
"lzma", "xz",
"zstd", "brotli", "lz4", "snappy", "lzw", "bzip2",
"lzo", "lzx", "quantum", "lzfse", "adc",
"rar1", "rar2", "rar3", "rar5",
]
# Enables `alloc`-backed conveniences (e.g. the `factory` module, the
# `compcol::vec` one-shot helpers). Pulled in automatically by features
# that require heap allocation.
= []
# Enables the `compcol::io` adapters that wrap `std::io::{Read, Write}`
# around any `Encoder`/`Decoder`, plus `From<Error> for std::io::Error`
# and `impl std::error::Error for Error`. Pulls in `alloc`.
= ["alloc"]
# Runtime by-name lookup that returns boxed trait objects. Requires `alloc`.
= ["alloc"]
# Run-length encoding.
= []
# RFC 1951 raw deflate. Requires `alloc` for the 32 KiB sliding window and
# the per-block symbol/bit buffers.
= ["alloc"]
# RFC 1950 zlib (deflate + Adler-32 + 2-byte header / 4-byte trailer).
= ["deflate"]
# RFC 1952 gzip (deflate + CRC-32 + 10-byte header / 8-byte trailer).
= ["deflate"]
# LZMA (Lempel–Ziv–Markov chain). Range-coded, depends on alloc for the
# probability tables and the LZ window.
= ["alloc"]
# xz container (RFC-style stream/block headers + check codes; the inner
# LZMA2 chunk codec is inlined inside `src/xz/`).
= ["lzma"]
# Zstandard (RFC 8478).
= ["alloc"]
# Brotli (RFC 7932). Carries a 170 KiB built-in static dictionary when fully
# implemented; expect a fat .rlib once it is.
= ["alloc"]
# LZ4 block format.
= ["alloc"]
# Google Snappy.
= ["alloc"]
# Lempel–Ziv–Welch (Unix compress / GIF).
= ["alloc"]
# bzip2 (block-sorted: RLE-1 → BWT → MTF → RLE-2 → Huffman). Encoder
# and decoder both implemented; the encoder uses a naive O(n² log n)
# suffix-array build (rather than SA-IS) for the BWT.
= ["alloc"]
# LZO (Lempel–Ziv–Oberhumer), LZO1X-1 variant.
= ["alloc"]
# LZX (Microsoft CAB / WIM compression).
= ["alloc"]
# Quantum (Stac, old CAB format). Decoder-only target.
= ["alloc"]
# LZFSE (Apple's LZ77 + Finite State Entropy). Decoder-only target — the
# encoder permanently returns `Error::Unsupported`. Handles `bvx-` and
# `bvxn` (LZVN) blocks; `bvx2` blocks return Unsupported in this build.
= ["alloc"]
# ADC (Apple Data Compression) — the LZSS-like codec used in Apple DMG
# disk images and HFS+ compressed resource forks.
= ["alloc"]
# RAR decoders (rar1, rar2, rar3, rar5). Decoder-only — RARLAB's unRAR
# license explicitly forbids re-creating the compression algorithm, so
# the encoders permanently return `Error::Unsupported`.
= ["alloc"]
= ["alloc"]
= ["alloc"]
= ["alloc"]
# `compcol::tokio_io` — async mirrors of compcol::io for the tokio
# runtime. Pulls the tokio dependency for its AsyncRead/AsyncWrite
# trait definitions; the rest of the crate stays dep-free.
= ["std", "dep:tokio"]
[]
= "forbid"
[]
# Optional, pulled in only by the `tokio` feature. We need the AsyncRead/
# AsyncWrite traits, which live under the default-off `io-util` feature
# in tokio's modular layout.
= { = "1", = false, = true }
[]
# Test-only: the async tests need a runtime + the AsyncReadExt /
# AsyncWriteExt convenience methods that the library itself doesn't
# use. Production consumers can pick their own tokio feature set.
= { = "1", = false, = ["rt", "macros", "io-util"] }
[[]]
= "compcol"
= "src/bin/compcol.rs"
= ["factory"]
[[]]
= "bench"
= "examples/bench.rs"
= ["factory"]