pub struct ConnectionPool { /* private fields */ }Expand description
Connection pool for HTTP/1.1 and HTTP/2
Implementations§
Source§impl ConnectionPool
impl ConnectionPool
Sourcepub fn new(target_addr: String, config: PoolConfig) -> Self
pub fn new(target_addr: String, config: PoolConfig) -> Self
Create a new connection pool
Sourcepub async fn acquire_h1(
&self,
) -> Result<SendRequest<BoxBody<Bytes, Box<dyn Error + Send + Sync>>>, ConnectionPoolError>
pub async fn acquire_h1( &self, ) -> Result<SendRequest<BoxBody<Bytes, Box<dyn Error + Send + Sync>>>, ConnectionPoolError>
Acquire an HTTP/1.1 connection from the pool or create a new one
Sourcepub async fn release_h1(
&self,
sender: SendRequest<BoxBody<Bytes, Box<dyn Error + Send + Sync>>>,
)
pub async fn release_h1( &self, sender: SendRequest<BoxBody<Bytes, Box<dyn Error + Send + Sync>>>, )
Release an HTTP/1.1 connection back to the pool
Sourcepub async fn acquire_h2(
&self,
) -> Result<SendRequest<BoxBody<Bytes, Box<dyn Error + Send + Sync>>>, ConnectionPoolError>
pub async fn acquire_h2( &self, ) -> Result<SendRequest<BoxBody<Bytes, Box<dyn Error + Send + Sync>>>, ConnectionPoolError>
Acquire an HTTP/2 connection (multiplexed, shared)
Sourcepub async fn evict_expired(&self)
pub async fn evict_expired(&self)
Evict expired connections from the pool
Auto Trait Implementations§
impl Freeze for ConnectionPool
impl !RefUnwindSafe for ConnectionPool
impl Send for ConnectionPool
impl Sync for ConnectionPool
impl Unpin for ConnectionPool
impl UnsafeUnpin for ConnectionPool
impl !UnwindSafe for ConnectionPool
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