pub struct Pool { /* private fields */ }Implementations§
Source§impl Pool
impl Pool
pub fn new(max_per_host: usize, idle: Duration) -> Self
Sourcepub fn acquire(&mut self, key: &PoolKey, now: Instant) -> Acquire
pub fn acquire(&mut self, key: &PoolKey, now: Instant) -> Acquire
A Connect reservation counts immediately, so concurrent callers cannot overbook.
pub fn connected( &mut self, id: ConnectionId, protocol: Protocol, max_streams: usize, ) -> Result<()>
pub fn release( &mut self, id: ConnectionId, reusable: bool, now: Instant, ) -> Result<()>
pub fn closed(&mut self, id: ConnectionId) -> Result<()>
pub fn next_timeout(&self) -> Option<Instant>
Sourcepub fn handle_timeout(&mut self, now: Instant) -> Option<ConnectionId>
pub fn handle_timeout(&mut self, now: Instant) -> Option<ConnectionId>
Repeatedly call to obtain all Close requests at this time. No clock or timer is owned.
Auto Trait Implementations§
impl Freeze for Pool
impl RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
impl UnwindSafe 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