pub struct KeyedPool<K: 'static, A: 'static, E: 'static> { /* private fields */ }Expand description
Pool partitioned by key; total concurrent checkouts across all keys is bounded by capacity.
Implementations§
Source§impl<K, A, E> KeyedPool<K, A, E>
impl<K, A, E> KeyedPool<K, A, E>
Sourcepub fn make<F>(capacity: usize, factory: F) -> Effect<Self, Never, ()>
pub fn make<F>(capacity: usize, factory: F) -> Effect<Self, Never, ()>
Build a keyed pool with global capacity and per-key factory for new values.
Sourcepub fn make_with_ttl<F>(
capacity: usize,
ttl: Duration,
factory: F,
) -> Effect<Self, Never, ()>
pub fn make_with_ttl<F>( capacity: usize, ttl: Duration, factory: F, ) -> Effect<Self, Never, ()>
Same as Self::make, but idle slots older than ttl are discarded on checkout.
Trait Implementations§
Auto Trait Implementations§
impl<K, A, E> Freeze for KeyedPool<K, A, E>
impl<K, A, E> !RefUnwindSafe for KeyedPool<K, A, E>
impl<K, A, E> Send for KeyedPool<K, A, E>
impl<K, A, E> Sync for KeyedPool<K, A, E>
impl<K, A, E> Unpin for KeyedPool<K, A, E>
impl<K, A, E> UnsafeUnpin for KeyedPool<K, A, E>
impl<K, A, E> !UnwindSafe for KeyedPool<K, A, E>
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