From 9631c7957efd7ff16780d2045e441d3acb5f10b5 Mon Sep 17 00:00:00 2001 From: glendc Date: Thu, 5 Sep 2024 09:56:50 +0200 Subject: [PATCH] inline crate* imports (doc) + fix HttpClientExt no-run snippets --- README.md | 2 +- docs/book/src/http_clients.md | 2 +- src/context.rs | 3 +++ src/http.rs | 4 ++++ src/lib.rs | 11 ++++++++++- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a64bc49c..f96b83d1 100644 --- a/README.md +++ b/README.md @@ -286,7 +286,7 @@ As a 🍒 cherry on the cake you can import the [`HttpClientExt`](https://ramapr > 💡 The full "high level" example can be found at [/examples/http_high_level_client.rs](https://github.com/plabayo/rama/tree/main/examples/http_high_level_client.rs). ```rust -use rama::http::client::HttpClientExt; +use rama::http::service::client::HttpClientExt; let client = ( TraceLayer::new_for_http(), diff --git a/docs/book/src/http_clients.md b/docs/book/src/http_clients.md index 0a821491..9bafc735 100644 --- a/docs/book/src/http_clients.md +++ b/docs/book/src/http_clients.md @@ -15,7 +15,7 @@ As a 🍒 cherry on the cake you can import the [`HttpClientExt`](https://ramapr > The full "high level" example can be found at . ```rust -use rama::http::client::HttpClientExt; +use rama::http::service::client::HttpClientExt; let client = ( TraceLayer::new_for_http(), diff --git a/src/context.rs b/src/context.rs index 5a368d09..4939320d 100644 --- a/src/context.rs +++ b/src/context.rs @@ -59,5 +59,8 @@ //! //! [`TcpListener`]: crate::tcp::server::TcpListener +#[doc(inline)] pub use ::rama_core::context as context; + +#[doc(inline)] pub use ::rama_macros::AsRef; diff --git a/src/http.rs b/src/http.rs index 73e95c65..fc541293 100644 --- a/src/http.rs +++ b/src/http.rs @@ -3,6 +3,7 @@ //! mostly contains re-exports from //! `rama-http` and `rama-http-backend`. +#[doc(inline)] pub use ::rama_http::{ dep, header, headers, io, matcher, response::{self, IntoResponse, Response}, @@ -16,11 +17,14 @@ pub mod layer { //! mostly contains re-exports from //! `rama-http` and `rama-http-backend`. + #[doc(inline)] pub use ::rama_http::layer::*; #[cfg(feature = "http-full")] + #[doc(inline)] pub use ::rama_http_backend::server::layer::*; } #[cfg(feature = "http-full")] +#[doc(inline)] pub use ::rama_http_backend::{client, server}; diff --git a/src/lib.rs b/src/lib.rs index 9536c710..2c77be27 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -198,7 +198,7 @@ //! ```rust,ignore //! # #[cfg(feature = "do-not-ever-run")] //! # { -//! use rama::http::client::HttpClientExt; +//! use rama::http::service::client::HttpClientExt; //! //! let client = ( //! TraceLayer::new_for_http(), @@ -276,21 +276,26 @@ #![cfg_attr(test, allow(clippy::float_cmp))] #![cfg_attr(not(test), warn(clippy::print_stdout, clippy::dbg_macro))] +#[doc(inline)] pub use ::rama_core::{ combinators, context, dns, error, graceful, layer, matcher, rt, service, username, Context, Layer, Service, }; #[cfg(feature = "tcp")] +#[doc(inline)] pub use ::rama_tcp as tcp; #[cfg(feature = "telemetry")] +#[doc(inline)] pub use ::rama_core::telemetry; #[cfg(feature = "tls")] +#[doc(inline)] pub use ::rama_tls as tls; #[cfg(feature = "net")] +#[doc(inline)] pub use ::rama_net as net; #[cfg(feature = "http")] @@ -301,16 +306,20 @@ pub mod proxy { //! rama proxy support #[cfg(feature = "proxy")] + #[doc(inline)] pub use ::rama_proxy::*; #[cfg(feature = "haproxy")] + #[doc(inline)] pub use ::rama_haproxy as haproxy; } #[cfg(feature = "ua")] +#[doc(inline)] pub use ::rama_ua as ua; #[cfg(feature = "cli")] pub mod cli; +#[doc(inline)] pub use ::rama_utils as utils;