Skip to content

Commit 15108d2

Browse files
committed
Document quinn feature flags.
1 parent eee334d commit 15108d2

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

quinn/src/lib.rs

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,56 @@
3737
//! authority. If this is infeasible--for example, if servers are short-lived or not associated
3838
//! with a domain name--then as with TLS, self-signed certificates can be used to provide
3939
//! encryption alone.
40+
//!
41+
//! # Feature flags
42+
//!
43+
//! ### Crypto features
44+
//!
45+
//! These features control which crypto providers quinn will use. Currently rustls is the only one baked into this crate.
46+
//! See [quinn-boring](https://github.com/quinn-rs/quinn-boring/) for an example of integrating another crypto provider.
47+
//!
48+
//! - `rustls`: Enable rustls as the crypto provider for quinn.
49+
//!
50+
//! ### Miscellaneous features
51+
//!
52+
//! - `bloom`: Enabled by default. Enables `BloomTokenLog`, and uses it by default.
53+
//! - `platform-verifier`: Enabled by default. Provides `ClientConfig::with_platform_verifier()` convenience method.
54+
//! - `futures-io`: Enables `futures::io::{AsyncRead, AsyncWrite}` support for streams.
55+
//!
56+
//! ### Logging features
57+
//!
58+
//! This will cause a dependency on the `log` crate and will cause logs to be emitted at
59+
//! various log levels, for code in quinn or its dependencies.
60+
//!
61+
//! - `qlog`: Enabled QUIC logs in the [qlog format](https://quicwg.org/qlog/draft-ietf-quic-qlog-main-schema.html).
62+
//! - `rustls-log`: Enables logging in the rustls create.
63+
//! - `lock_tracking`: Records how long locks are held, and warns if they are held >= 1ms.
64+
//! - `tracing-log`: Configure `tracing` to log events via `log` if no `tracing` subscriber exists.
65+
//!
66+
//! ### Crypto features
67+
//!
68+
//! The three supported rustls backends are rustls+ring, rustls+aws-lc-rs and rustls+aws-lc-rs-fips.
69+
//! Note the feature default for rustls is to use aws-lc-rs and the default for quinn is to use ring. This means you might
70+
//! want `default-features = false` on one library or the other if you don't intend to use multiple rustls backends.
71+
//!
72+
//! - `rustls-ring`: Enables ring crypto backend for quinn and rustls. Requires the `ring` feature.
73+
//! - `ring`: Will enable ring for quinn only. Generally used with `rustls-ring`.
74+
//! - `rustls-aws-lc-rs`: Enables aws-lc-rs crypto backend for quinn and rustls. Requires the `aws-lc-rs` feature.
75+
//! - `aws-lc-rs`: Enables aws-lc-rs crypto backend for quinn only. Generally used with `rustls-aws-lc-rs`.
76+
//! - `rustls-aws-lc-rs-fips`: Enables aws-lc-rs-fips crypto backend for quinn and rustls. Requires the aws-lc-rs-fips feature.
77+
//! - `aws-lc-rs-fips`: Enables aws-lc-rs-fips for quinn only. Generally used with `rustls-aws-lc-rs-fips`.
78+
//!
79+
//! ### Runtime features
80+
//!
81+
//! These features will integrate quinn with different async runtimes.
82+
//! The convenience functions `Endpoint::server` and `Endpoint::client` will only work with the tokio or
83+
//! smol runtime features enabled. If you're using a different or custom runtime you'll need to use `Endpoint::new` and
84+
//! pass in a `Arc<dyn Runtime>` directly.
85+
//!
86+
//! - `runtime-tokio`: Enable integration with the tokio async runtime.
87+
//! - `runtime-smol`: Enable integration with the smol runtime.
88+
//! - `smol`: Also enable integration with the smol runtime.
89+
//! - `async-io`: Also required to enable integration with the smol runtime.
4090
#![warn(missing_docs)]
4191
#![warn(unreachable_pub)]
4292
#![warn(clippy::use_self)]

0 commit comments

Comments
 (0)