From 282643eae3498bf789ee101828eb1b4392c4cdd4 Mon Sep 17 00:00:00 2001 From: RamziA961 <60425857+RamziA961@users.noreply.github.com> Date: Sat, 30 Sep 2023 19:08:17 +0100 Subject: [PATCH] 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. --- src/lib.rs | 15 ++++++++++++++- src/trace.rs | 27 --------------------------- 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 230208fb5b..0d1db8320a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; diff --git a/src/trace.rs b/src/trace.rs index 73222205a3..ca6e419e3d 100644 --- a/src/trace.rs +++ b/src/trace.rs @@ -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!( "\