rust-lang / flate2-rs

DEFLATE, gzip, and zlib bindings for Rust
https://docs.rs/flate2
Apache License 2.0
862 stars 159 forks source link

Feature request: `set_dictionary` in pure Rust backend #358

Closed torokati44 closed 1 year ago

torokati44 commented 1 year ago

I'd like to use the mentioned functionality in a project that is built to WASM, so only using native Rust stuff is preferred.

Based on https://github.com/rust-lang/flate2-rs/pull/74#issuecomment-372338710, adding this "should be relatively simple".

torokati44 commented 1 year ago

Actually, for this purpose, if any of the available zlib backends supports seamless compiling to WASM from source, that would also work... :no_mouth:

Byron commented 1 year ago

Thanks for posting. After taking a closer look, I believe this feature request should first be posted over at the miniz_oxide which is the implementation used here when the Rust backend is chosen.

Once available, it should be trivial to make set_dictionary available here.

WASM support is available in this crate as well, even though it does seem to default to miniz_oxide when that happens. Thus the way forward truly seems to be to get the desired feature implemented in miniz_oxide.

For that reason, I am closing the issue here as I trust you will open a new one once the pre-requisites are fulfilled. Thanks for your understanding.