feat(embed): embed::flate, the low-level API absorbed from minizlib - #135
Merged
Merged
Conversation
Adds `compcol::embed::flate` (with `embed` + `deflate`): the full API of the retired minizlib crate, so that minizlib can become a re-export of it. The memory is all the caller's: decode into the caller's buffer or through a window of any size, pull input through a callback (`Reader`), an iterator (`Bytes`) or any `Input`, or push it (`Decompressor`); output to a `Buffer`, a `Stream` callback or a `Counter`; compress a chunk at a time with the caller's table (`Compressor`, `BufferedCompressor`). It has its own `Error`, which tells I/O failures and too small a window apart. minizlib's fine-grained features are fixed to their defaults: checksums verified, concatenated gzip members and all block types decoded, 16-entry CRC-32 table (shared with `embed`'s own codecs). - Tests: minizlib's suite, round-tripping against flate2 (new dev-dep). - Footprint: seven `flate` configurations added to tools/footprint, with ceilings documented in `compcol::embed`; no panic machinery linked, sizes within a few bytes of minizlib 0.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 3, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
compcol::embed::flate(needsembed+deflate), which is the full public API of theminizlibcrate. Once this ships as 0.7.1, minizlib becomes a deprecated re-export of it, with no change to its API.Unlike the
Encoder/Decodercodecs, which own their window and table, this module uses only memory the caller provides:gunzip/unzlib/inflate/decompress(autodetects gzip or zlib), and*_lento only count. Output goes into the caller'sBuffer(which doubles as the history window), through aStreamwindow of any size, or into aCounter. Input is pulled throughReader(a callback),Bytes(an iterator) or anyInput, or pushed into aDecompressor.gzip/zlib/deflate,Compressor(one chunk at a time) andBufferedCompressor, all using a hash table the caller provides, of any size.Error, which keeps I/O failures (Io) and a too-small window (WindowTooSmall) apart from other errors.minizlib's fine-grained features are fixed at their defaults:
embed's own codecs.Footprint
Seven
flateconfigurations are added totools/footprint. Their ceilings are documented incompcol::embedand README. None links any panic machinery, and the measurements match minizlib 0.1 to within a few bytes:gunzip, buffer outgunzip, streamsgunzip_lenDecompressorgzip, buffer outCompressor, streamsBufferedCompressorflate's CRC-32 and Adler-32 start from their standard initial values, not from all zeros. With all zeros, LLVM clears aDecompressorwithmemclr8, which links about 200 extra bytes.Tests
minizlib's test suite is ported as
tests/embed_flate_*.rs, and CI's embed test step now runs it.These checks pass locally:
--features all,--all-features,embed,gzipandembed;-D warnings;cargo test --all-features;tools/footprint/check.sh.🤖 Generated with Claude Code