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
//! Adaptors between compression crates and Rust's modern asynchronous IO types.
//!
//!
//! # Feature Organization
//!
//! This crate is divided up along two axes, which can each be individually selected via Cargo
//! features.
//!
//! ## IO type
//!
//! The first division is which underlying asynchronous IO type will be wrapped, these are
//! available as two separate features that have corresponding top-level modules:
//!
//!  * [`bufread`] provides types which operate over [`AsyncBufRead`](futures::io::AsyncBufRead)
//!    streams
//!
//!  * [`stream`] provides types which operate over [`Stream`](futures::stream::Stream)`<Item =
//!    `[`io::Result`](std::io::Result)`<`[`Bytes`](bytes::Bytes)`>>` streams
//!
//! ## Compression implementation
//!
//! The second division is which compression scheme to use, there are currently a few available
//! choices, these determine which types will be available inside the above modules:
//!
//!  * `brotli`
//!  * `deflate`
//!  * `gzip`
//!  * `zlib`
//!  * `zstd`

#![warn(
    missing_docs,
    rust_2018_idioms,
    missing_copy_implementations,
    missing_debug_implementations
)]

#[cfg(feature = "bufread")]
pub mod bufread;
#[cfg(feature = "stream")]
pub mod stream;

/// Types to configure [`flate2`](::flate2) based encoders.
#[cfg(any(feature = "deflate", feature = "zlib", feature = "gzip"))]
pub mod flate2 {
    pub use flate2::Compression;
}

/// Types to configure [`brotli2`](::brotli2) based encoders.
#[cfg(feature = "brotli")]
pub mod brotli2 {
    pub use brotli2::CompressParams;
}