Skip to content

Commit

Permalink
docs(trace): move trace documentation to lib and reduce information
Browse files Browse the repository at this point in the history
Remove `trace` documetationfrom `trace.rs`. Add unstable section to
`lib.rs` detailing unstable features. Add information about `tracing`
and `ffi` to unstable features section.
  • Loading branch information
RamziA961 committed Sep 30, 2023
1 parent 32c1df7 commit 282643e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
15 changes: 14 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,20 @@
//! - `server`: Enables the HTTP `server`.
//!
//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section
//!
//! # Unstable Features
//! hyper includes a set of unstable optional features that can be enabled through the use of a
//! feature flag and a [configuration flag].
//!
//! The following is a list of feature flags and their corresponding `RUSTFLAG`:
//! - `ffi`: Enables C API for hyper `hyper_unstable_ffi`.
//! - `tracing`: Enables debug logging with `hyper_unstable_tracing`.
//!
//! Enabling an unstable feature is possible with the following `cargo` command, as of version `1.64.0`:
//! ```notrust
//! RUSTFLAGS="--cfg hyper_unstable_tracing" cargo rustc --features client,http1,http2,tracing --crate-type cdylib
//!```
//! [configuration flag]: https://doc.rust-lang.org/reference/conditional-compilation.html
#[doc(hidden)]
pub use http;

Expand Down
27 changes: 0 additions & 27 deletions src/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,6 @@
// even if they are not used at the present time.
#![allow(unused_macros)]

//! Internal Tracing macro module
//!
//! The [`trace`][crate::trace] module is an internal module that contains wrapper macros encapsulating
//! [`tracing`][tracing]'s macros. These macros allow for conditional expansion of
//! [`tracing`][tracing] macros during compilation when the `tracing` feature is enabled, or trimming
//! them when the feature is disabled, all in a concise manner.
//!
//! The macros from the [`trace`][crate::trace] module are declared by default and can be used throughout the
//! crate. However, as the contents of these macros are conditionally compiled, they are effectively trimmed
//! during inline expansion when the `tracing` feature is disabled.
//!
//! # Unstable
//!
//! The [`tracing`][tracing] module is currenty **unstable**, hence the existence of this module. As a
//! result, hyper's [`tracing`][tracing] logs are only accessibe if `--cfg hyper_unstable_tracing` is
//! passed to `rustc` when compiling. The easiest way to do that is through setting the `RUSTFLAGS`
//! enviornment variable.
//!
//! # Building
//!
//! Enabling [`trace`][crate::trace] logs, can be done with the following `cargo` command, as of
//! version `1.64.0`:
//!
//! ```notrust
//! RUSTFLAGS="--cfg hyper_unstable_tracing" cargo rustc --features client,http1,http2,tracing --crate-type cdylib
//! ```
#[cfg(not(hyper_unstable_tracing))]
compile_error!(
"\
Expand Down

0 comments on commit 282643e

Please sign in to comment.