Skip to content

Commit 282643e

Browse files
committed
docs(trace): move trace documentation to lib and reduce information
Remove `trace` documetationfrom `trace.rs`. Add unstable section to `lib.rs` detailing unstable features. Add information about `tracing` and `ffi` to unstable features section.
1 parent 32c1df7 commit 282643e

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

src/lib.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,20 @@
5151
//! - `server`: Enables the HTTP `server`.
5252
//!
5353
//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section
54-
54+
//!
55+
//! # Unstable Features
56+
//! hyper includes a set of unstable optional features that can be enabled through the use of a
57+
//! feature flag and a [configuration flag].
58+
//!
59+
//! The following is a list of feature flags and their corresponding `RUSTFLAG`:
60+
//! - `ffi`: Enables C API for hyper `hyper_unstable_ffi`.
61+
//! - `tracing`: Enables debug logging with `hyper_unstable_tracing`.
62+
//!
63+
//! Enabling an unstable feature is possible with the following `cargo` command, as of version `1.64.0`:
64+
//! ```notrust
65+
//! RUSTFLAGS="--cfg hyper_unstable_tracing" cargo rustc --features client,http1,http2,tracing --crate-type cdylib
66+
//!```
67+
//! [configuration flag]: https://doc.rust-lang.org/reference/conditional-compilation.html
5568
#[doc(hidden)]
5669
pub use http;
5770

src/trace.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,6 @@
22
// even if they are not used at the present time.
33
#![allow(unused_macros)]
44

5-
//! Internal Tracing macro module
6-
//!
7-
//! The [`trace`][crate::trace] module is an internal module that contains wrapper macros encapsulating
8-
//! [`tracing`][tracing]'s macros. These macros allow for conditional expansion of
9-
//! [`tracing`][tracing] macros during compilation when the `tracing` feature is enabled, or trimming
10-
//! them when the feature is disabled, all in a concise manner.
11-
//!
12-
//! The macros from the [`trace`][crate::trace] module are declared by default and can be used throughout the
13-
//! crate. However, as the contents of these macros are conditionally compiled, they are effectively trimmed
14-
//! during inline expansion when the `tracing` feature is disabled.
15-
//!
16-
//! # Unstable
17-
//!
18-
//! The [`tracing`][tracing] module is currenty **unstable**, hence the existence of this module. As a
19-
//! result, hyper's [`tracing`][tracing] logs are only accessibe if `--cfg hyper_unstable_tracing` is
20-
//! passed to `rustc` when compiling. The easiest way to do that is through setting the `RUSTFLAGS`
21-
//! enviornment variable.
22-
//!
23-
//! # Building
24-
//!
25-
//! Enabling [`trace`][crate::trace] logs, can be done with the following `cargo` command, as of
26-
//! version `1.64.0`:
27-
//!
28-
//! ```notrust
29-
//! RUSTFLAGS="--cfg hyper_unstable_tracing" cargo rustc --features client,http1,http2,tracing --crate-type cdylib
30-
//! ```
31-
325
#[cfg(not(hyper_unstable_tracing))]
336
compile_error!(
347
"\

0 commit comments

Comments
 (0)