Skip to content

Commit a086079

Browse files
committed
Improve algorithm feature documentation
1 parent 03d240e commit a086079

File tree

1 file changed

+56
-14
lines changed

1 file changed

+56
-14
lines changed

src/lib.rs

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Adaptors between compression crates and Rust's modern asynchronous IO types.
22
//!
3-
//!
3+
44
//! # Feature Organization
55
//!
66
//! This crate is divided up along two axes, which can each be individually selected via Cargo
@@ -11,17 +11,20 @@
1111
//!
1212
//! If you want to pull in everything there are three group features defined:
1313
//!
14+
1415
//! Feature | Does
1516
//! ---------|------
1617
//! `all` | Activates all implementations and algorithms.
1718
//! `all-implementations` | Activates all implementations, needs to be pared with a selection of algorithms
1819
//! `all-algorithms` | Activates all algorithms, needs to be pared with a selection of implementations
1920
//!
21+
2022
//! ## IO implementation
2123
//!
2224
//! The first division is which underlying asynchronous IO trait will be wrapped, these are
2325
//! available as separate features that have corresponding top-level modules:
2426
//!
27+
2528
//! Feature | Type
2629
//! ---------|------
2730
// TODO: Kill rustfmt on this section, `#![rustfmt::skip::attributes(cfg_attr)]` should do it, but
@@ -51,24 +54,63 @@
5154
doc = "`stream` (*inactive*) | `futures::stream::Stream<Item = std::io::Result<bytes::Bytes>>`"
5255
)]
5356
//!
54-
//!
57+
5558
//! ## Compression algorithm
5659
//!
5760
//! The second division is which compression schemes to support, there are currently a few
5861
//! available choices, these determine which types will be available inside the above modules:
5962
//!
60-
#![cfg_attr(feature = "brotli", doc = "* `brotli`")]
61-
#![cfg_attr(not(feature = "brotli"), doc = "* `brotli` (*inactive*)")]
62-
#![cfg_attr(feature = "bzip", doc = "* `bzip`")]
63-
#![cfg_attr(not(feature = "bzip"), doc = "* `bzip` (*inactive*)")]
64-
#![cfg_attr(feature = "deflate", doc = "* `deflate`")]
65-
#![cfg_attr(not(feature = "deflate"), doc = "* `deflate` (*inactive*)")]
66-
#![cfg_attr(feature = "gzip", doc = "* `gzip`")]
67-
#![cfg_attr(not(feature = "gzip"), doc = "* `gzip` (*inactive*)")]
68-
#![cfg_attr(feature = "zlib", doc = "* `zlib`")]
69-
#![cfg_attr(not(feature = "zlib"), doc = "* `zlib` (*inactive*)")]
70-
#![cfg_attr(feature = "zstd", doc = "* `zstd`")]
71-
#![cfg_attr(not(feature = "zstd"), doc = "* `zstd` (*inactive*)")]
63+
64+
//! Feature | Types
65+
//! ---------|------
66+
#![cfg_attr(
67+
feature = "brotli",
68+
doc = "`brotli` | [`BrotliEncoder`](?search=BrotliEncoder), [`BrotliDecoder`](?search=BrotliDecoder)"
69+
)]
70+
#![cfg_attr(
71+
not(feature = "brotli"),
72+
doc = "`brotli` (*inactive*) | `BrotliEncoder`, `BrotliDecoder`"
73+
)]
74+
#![cfg_attr(
75+
feature = "bzip",
76+
doc = "`bzip` | [`BzEncoder`](?search=BzEncoder), [`BzDecoder`](?search=BzDecoder)"
77+
)]
78+
#![cfg_attr(
79+
not(feature = "bzip"),
80+
doc = "`bzip` (*inactive*) | `BzEncoder`, `BzDecoder`"
81+
)]
82+
#![cfg_attr(
83+
feature = "deflate",
84+
doc = "`deflate` | [`DeflateEncoder`](?search=DeflateEncoder), [`DeflateDecoder`](?search=DeflateDecoder)"
85+
)]
86+
#![cfg_attr(
87+
not(feature = "deflate"),
88+
doc = "`deflate` (*inactive*) | `DeflateEncoder`, `DeflateDecoder`"
89+
)]
90+
#![cfg_attr(
91+
feature = "gzip",
92+
doc = "`gzip` | [`GzipEncoder`](?search=GzipEncoder), [`GzipDecoder`](?search=GzipDecoder)"
93+
)]
94+
#![cfg_attr(
95+
not(feature = "gzip"),
96+
doc = "`gzip` (*inactive*) | `GzipEncoder`, `GzipDecoder`"
97+
)]
98+
#![cfg_attr(
99+
feature = "zlib",
100+
doc = "`zlib` | [`ZlibEncoder`](?search=ZlibEncoder), [`ZlibDecoder`](?search=ZlibDecoder)"
101+
)]
102+
#![cfg_attr(
103+
not(feature = "zlib"),
104+
doc = "`zlib` (*inactive*) | `ZlibEncoder`, `ZlibDecoder`"
105+
)]
106+
#![cfg_attr(
107+
feature = "zstd",
108+
doc = "`zstd` | [`ZstdEncoder`](?search=ZstdEncoder), [`ZstdDecoder`](?search=ZstdDecoder)"
109+
)]
110+
#![cfg_attr(
111+
not(feature = "zstd"),
112+
doc = "`zstd` (*inactive*) | `ZstdEncoder`, `ZstdDecoder`"
113+
)]
72114
//!
73115
74116
#![cfg_attr(docsrs, feature(doc_cfg))]

0 commit comments

Comments
 (0)