|
1 | 1 | //! Adaptors between compression crates and Rust's modern asynchronous IO types.
|
2 | 2 | //!
|
3 |
| -//! |
| 3 | +
|
4 | 4 | //! # Feature Organization
|
5 | 5 | //!
|
6 | 6 | //! This crate is divided up along two axes, which can each be individually selected via Cargo
|
7 | 7 | //! features.
|
8 | 8 | //!
|
9 |
| -//! All features are default active, it's recommended you use this crate with `default-features = |
10 |
| -//! false` and enable just the features you need. (We're considering disabling this and shipping |
11 |
| -//! with no features active by default, please [leave a comment][#46] if you have an opinion either |
12 |
| -//! way). |
| 9 | +//! All features are disabled by default, you should enable just the ones you need from the lists |
| 10 | +//! below. |
13 | 11 | //!
|
14 |
| -//! [#46]: https://github.com/rustasync/async-compression/issues/46 |
| 12 | +//! If you want to pull in everything there are three group features defined: |
15 | 13 | //!
|
16 |
| -//! ## IO type |
| 14 | +
|
| 15 | +//! Feature | Does |
| 16 | +//! ---------|------ |
| 17 | +//! `all` | Activates all implementations and algorithms. |
| 18 | +//! `all-implementations` | Activates all implementations, needs to be pared with a selection of algorithms |
| 19 | +//! `all-algorithms` | Activates all algorithms, needs to be pared with a selection of implementations |
17 | 20 | //!
|
18 |
| -//! The first division is which underlying asynchronous IO type will be wrapped, these are |
19 |
| -//! available as two separate features that have corresponding top-level modules: |
| 21 | +
|
| 22 | +//! ## IO implementation |
20 | 23 | //!
|
| 24 | +//! The first division is which underlying asynchronous IO trait will be wrapped, these are |
| 25 | +//! available as separate features that have corresponding top-level modules: |
| 26 | +//! |
| 27 | +
|
21 | 28 | //! Feature | Type
|
22 | 29 | //! ---------|------
|
23 | 30 | // TODO: Kill rustfmt on this section, `#![rustfmt::skip::attributes(cfg_attr)]` should do it, but
|
|
47 | 54 | doc = "`stream` (*inactive*) | `futures::stream::Stream<Item = std::io::Result<bytes::Bytes>>`"
|
48 | 55 | )]
|
49 | 56 | //!
|
| 57 | +
|
| 58 | +//! ## Compression algorithm |
50 | 59 | //!
|
51 |
| -//! ## Compression implementation |
52 |
| -//! |
53 |
| -//! The second division is which compression scheme to use, there are currently a few available |
54 |
| -//! choices, these determine which types will be available inside the above modules: |
| 60 | +//! The second division is which compression schemes to support, there are currently a few |
| 61 | +//! available choices, these determine which types will be available inside the above modules: |
55 | 62 | //!
|
56 |
| -#![cfg_attr(feature = "brotli", doc = "* `brotli`")] |
57 |
| -#![cfg_attr(not(feature = "brotli"), doc = "* `brotli` (*inactive*)")] |
58 |
| -#![cfg_attr(feature = "bzip", doc = "* `bzip`")] |
59 |
| -#![cfg_attr(not(feature = "bzip"), doc = "* `bzip` (*inactive*)")] |
60 |
| -#![cfg_attr(feature = "deflate", doc = "* `deflate`")] |
61 |
| -#![cfg_attr(not(feature = "deflate"), doc = "* `deflate` (*inactive*)")] |
62 |
| -#![cfg_attr(feature = "gzip", doc = "* `gzip`")] |
63 |
| -#![cfg_attr(not(feature = "gzip"), doc = "* `gzip` (*inactive*)")] |
64 |
| -#![cfg_attr(feature = "zlib", doc = "* `zlib`")] |
65 |
| -#![cfg_attr(not(feature = "zlib"), doc = "* `zlib` (*inactive*)")] |
66 |
| -#![cfg_attr(feature = "zstd", doc = "* `zstd`")] |
67 |
| -#![cfg_attr(not(feature = "zstd"), doc = "* `zstd` (*inactive*)")] |
| 63 | +
|
| 64 | +//! Feature | Types |
| 65 | +//! ---------|------ |
| 66 | +#, [`BrotliDecoder`](?search=BrotliDecoder)" |
| 69 | +)] |
| 70 | +#![cfg_attr( |
| 71 | + not(feature = "brotli"), |
| 72 | + doc = "`brotli` (*inactive*) | `BrotliEncoder`, `BrotliDecoder`" |
| 73 | +)] |
| 74 | +#, [`BzDecoder`](?search=BzDecoder)" |
| 77 | +)] |
| 78 | +#![cfg_attr( |
| 79 | + not(feature = "bzip"), |
| 80 | + doc = "`bzip` (*inactive*) | `BzEncoder`, `BzDecoder`" |
| 81 | +)] |
| 82 | +#, [`DeflateDecoder`](?search=DeflateDecoder)" |
| 85 | +)] |
| 86 | +#![cfg_attr( |
| 87 | + not(feature = "deflate"), |
| 88 | + doc = "`deflate` (*inactive*) | `DeflateEncoder`, `DeflateDecoder`" |
| 89 | +)] |
| 90 | +#, [`GzipDecoder`](?search=GzipDecoder)" |
| 93 | +)] |
| 94 | +#![cfg_attr( |
| 95 | + not(feature = "gzip"), |
| 96 | + doc = "`gzip` (*inactive*) | `GzipEncoder`, `GzipDecoder`" |
| 97 | +)] |
| 98 | +#, [`ZlibDecoder`](?search=ZlibDecoder)" |
| 101 | +)] |
| 102 | +#![cfg_attr( |
| 103 | + not(feature = "zlib"), |
| 104 | + doc = "`zlib` (*inactive*) | `ZlibEncoder`, `ZlibDecoder`" |
| 105 | +)] |
| 106 | +#, [`ZstdDecoder`](?search=ZstdDecoder)" |
| 109 | +)] |
| 110 | +#![cfg_attr( |
| 111 | + not(feature = "zstd"), |
| 112 | + doc = "`zstd` (*inactive*) | `ZstdEncoder`, `ZstdDecoder`" |
| 113 | +)] |
68 | 114 | //!
|
69 | 115 |
|
70 | 116 | #![cfg_attr(docsrs, feature(doc_cfg))]
|
|
0 commit comments