|
1 | 1 | //! A DEFLATE-based stream compression/decompression library
|
2 | 2 | //!
|
3 |
| -//! This library is meant to supplement/replace the |
4 |
| -//! `flate` library that was previously part of the standard rust distribution |
5 |
| -//! providing a streaming encoder/decoder rather than purely |
6 |
| -//! an in-memory encoder/decoder. |
7 |
| -//! |
8 |
| -//! Like with [`flate`], flate2 is based on [`miniz.c`][1] |
9 |
| -//! |
10 |
| -//! [1]: https://github.com/richgel999/miniz |
11 |
| -//! [`flate`]: https://github.com/rust-lang/rust/tree/1.19.0/src/libflate |
| 3 | +//! This library provides support for compression and decompression of |
| 4 | +//! DEFLATE-based streams: |
| 5 | +//! |
| 6 | +//! * the DEFLATE format itself |
| 7 | +//! * the zlib format |
| 8 | +//! * gzip |
| 9 | +//! |
| 10 | +//! These three formats are all closely related and largely only differ in their |
| 11 | +//! headers/footers. This crate has three types in each submodule for dealing |
| 12 | +//! with these three formats. |
| 13 | +//! |
| 14 | +//! # Implementation |
| 15 | +//! |
| 16 | +//! In addition to supporting three formats, this crate supports three different |
| 17 | +//! backends, controlled through this crate's features: |
| 18 | +//! |
| 19 | +//! * `default`, or `rust_backend` - this implementation uses the `miniz_oxide` |
| 20 | +//! crate which is a port of `miniz.c` (below) to Rust. This feature does not |
| 21 | +//! require a C compiler and only requires Rust code. |
| 22 | +//! |
| 23 | +//! * `miniz-sys` - when enabled this feature will enable this crate to instead |
| 24 | +//! use `miniz.c`, distributed with `miniz-sys`, to implement |
| 25 | +//! compression/decompression. |
| 26 | +//! |
| 27 | +//! * `zlib` - finally, this feature will enable linking against the `libz` |
| 28 | +//! library, typically found on most Linux systems by default. If the library |
| 29 | +//! isn't found to already be on the system it will be compiled from source |
| 30 | +//! (this is a C library). |
| 31 | +//! |
| 32 | +//! There's various tradeoffs associated with each implementation, but in |
| 33 | +//! general you probably won't have to tweak the defaults. The default choice is |
| 34 | +//! selected to avoid the need for a C compiler at build time. The `miniz-sys` |
| 35 | +//! feature is largely a historical artifact at this point and is unlikely to be |
| 36 | +//! needed, and `zlib` is often useful if you're already using `zlib` for other |
| 37 | +//! C dependencies. The compression ratios and performance of each of these |
| 38 | +//! feature should be roughly comparable, but you'll likely want to run your own |
| 39 | +//! tests if you're curious about the performance. |
12 | 40 | //!
|
13 | 41 | //! # Organization
|
14 | 42 | //!
|
|
0 commit comments