Skip to content

Commit

Permalink
inline crate* imports (doc) + fix HttpClientExt no-run snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
GlenDC committed Sep 5, 2024
1 parent 7568152 commit 9631c79
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
2 changes: 1 addition & 1 deletion docs/book/src/http_clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <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(),
Expand Down
3 changes: 3 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
4 changes: 4 additions & 0 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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};
11 changes: 10 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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")]
Expand All @@ -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;

0 comments on commit 9631c79

Please sign in to comment.