pub struct Pool { /* private fields */ }Expand description
The connection pool. Cheap to clone.
Implementations§
Source§impl Pool
impl Pool
Sourcepub fn new(
cfg: PoolConfig,
connect: ConnectConfig,
h1: H1Config,
h2: H2Config,
obs: Arc<dyn Observer>,
) -> Self
pub fn new( cfg: PoolConfig, connect: ConnectConfig, h1: H1Config, h2: H2Config, obs: Arc<dyn Observer>, ) -> Self
Creates an empty pool.
Sourcepub fn send(
&self,
req: Request<Body>,
) -> impl Future<Output = Result<Response<Incoming>>> + Send + use<>
pub fn send( &self, req: Request<Body>, ) -> impl Future<Output = Result<Response<Incoming>>> + Send + use<>
Sends req on a pooled connection (dialing if needed) and returns the response once its
head is available. The returned body returns the connection to the pool when it completes.
A request that fails on a reused HTTP/1 connection before any response byte (stale
keep-alive race) or with Recovery::Unprocessed is retried once on a fresh connection if
its body is replayable (Empty/Full) and the method is idempotent (or the error is
Unprocessed).
§Errors
Any transport/protocol error, PoolTimeout after checkout_timeout, InvalidRequest for
an unusable URI.
Sourcepub fn stats(&self, uri: &Uri) -> Option<OriginStats>
pub fn stats(&self, uri: &Uri) -> Option<OriginStats>
Diagnostics for the origin of uri.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Pool
impl !UnwindSafe for Pool
impl Forget for Pool
impl Freeze for Pool
impl Move for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more