Skip to content

Commit e79d093

Browse files
authored
docs(client): document the guarantees of cloning a Client (#2540)
Small docs improvement to mention that cloning a `Client` is cheap and will reuse the connection pool. Fixes #2239
1 parent d1d2f32 commit e79d093

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/client/client.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ use crate::common::{exec::BoxSendFuture, lazy as hyper_lazy, task, Future, Lazy,
1919
use crate::rt::Executor;
2020

2121
/// A Client to make outgoing HTTP requests.
22+
///
23+
/// `Client` is cheap to clone and cloning is the recommended way to share a `Client`. The
24+
/// underlying connection pool will be reused.
2225
#[cfg_attr(docsrs, doc(cfg(any(feature = "http1", feature = "http2"))))]
2326
pub struct Client<C, B = Body> {
2427
config: Config,

0 commit comments

Comments
 (0)