pub struct Pool<B: Backend, P: Policy, C> { /* private fields */ }Expand description
Cloneable pool. Checkout and release reuse retained slots after warm-up.
Implementations§
Source§impl<B: Backend + 'static, P: Policy, C: Connection> Pool<B, P, C>
impl<B: Backend + 'static, P: Policy, C: Connection> Pool<B, P, C>
pub fn new<F: Connector<B, Connection = C>>( executor: &ExecutorHandle<B>, policy: P, connector: F, connect_timeout: Duration, capacity: usize, ) -> Result<Self>
pub fn total(&self) -> usize
Sourcepub fn update_policy(&self, update: impl FnOnce(&mut P))
pub fn update_policy(&self, update: impl FnOnce(&mut P))
Apply a topology-driven policy change and wake the pool’s scheduler.
pub async fn acquire(&self, at: Instant) -> Result<Lease<B, P, C>>
pub async fn end(&self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl<B, P, C> !RefUnwindSafe for Pool<B, P, C>
impl<B, P, C> !Send for Pool<B, P, C>
impl<B, P, C> !Sync for Pool<B, P, C>
impl<B, P, C> !UnwindSafe for Pool<B, P, C>
impl<B, P, C> Forget for Pool<B, P, C>
impl<B, P, C> Freeze for Pool<B, P, C>
impl<B, P, C> Unpin for Pool<B, P, C>
impl<B, P, C> UnsafeUnpin for Pool<B, P, C>where
Rc<Owner<B, P, C>>: UnsafeUnpin,
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