hyper_util/lib.rs
1#![deny(missing_docs)]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3
4//! Utilities for working with hyper.
5//!
6//! This crate is less-stable than [`hyper`](https://docs.rs/hyper). However,
7//! does respect Rust's semantic version regarding breaking changes.
8//!
9//! # Feature flags
10//!
11//! `hyper-util` relies on feature flags to allow dependents to opt into
12//! building particular components. None of these feature flags are enabled by
13//! default. You may use the `full` feature flag to enable all of the standard
14//! features.
15//!
16//! Note that the `full` feature flag may introduce superfluous dependencies.
17//! You may improve compilation times by enabling the individual features that
18//! you need.
19//!
20//! **Client features**
21//!
22//! * `client`: Enable [`client`] interfaces.
23//! * `client-legacy`: Enable the legacy
24//! [`Client`][crate::client::legacy::Client] implementation.
25//! * `client-pool`: Enable [`client::pool`]. This submodule contains
26//! interfaces for constructing connection pools.
27//! * `client-proxy`: Enable [`client::proxy`].
28//! * `client-proxy-system`: Enable platform-specific system proxy support.
29//!
30//! **Server features**
31//!
32//! * `server`: Enable [`server`] interfaces.
33//! * `server-auto`: Enable automatic HTTP version.
34//! * `server-graceful`: Enable [`server::graceful`] interfaces for gracefully
35//! shutting down a server. See the module-level documentation of
36//! [`server::graceful`] for more information.
37//!
38//! **Other features**
39//!
40//! * `service`: Enable [`service`] interfaces for compatibility with tower's
41//! [`Service`][tower_service::Service]. See the module-level documentation
42//! of [`service`] for more information.
43//! * `http1`: Enable HTTP/1 support.
44//! * `http2`: Enable HTTP/2 support.
45//! * `tokio`: Enable [`rt::tokio`] runtime components to integrate with
46//! [`tokio`]. See the module-level documentation of [`rt::tokio`] for more
47//! information.
48//! * `tracing`: Enable [`rt::tracing`] runtime components to integrate with
49//! [`tracing`]. See the module-level documentation of [`rt::tracing`] for
50//! more information.
51//! * `rt-tracing-exec-force`: A temporary compatibility opt-in feature to
52//! facilitate migrating telemetry from v0.1.20. If set,
53//! [`rt::tokio::TokioExecutor<I>`] will continue to propagate the current
54//! [`tracing::Span`] to spawned tasks. This may be removed in a future
55//! release. Note that this feature is **not** included in the `full`
56//! feature set, and must be explicitly enabled. See
57//! [#322](https://github.com/hyperium/hyper-util/pull/322) and
58//! [#323](https://github.com/hyperium/hyper-util/pull/323) for more
59//! information.
60
61#[cfg(feature = "client")]
62pub mod client;
63mod common;
64pub mod rt;
65#[cfg(feature = "server")]
66pub mod server;
67#[cfg(any(feature = "service", feature = "client-legacy"))]
68pub mod service;