pub struct AsyncPoolRegistry<K, T, F> { /* private fields */ }Expand description
Hands out one AsyncConnectionPool per key, built on first use. Lazy: pools are not opened
automatically.
Implementations§
Source§impl<K, T, F> AsyncPoolRegistry<K, T, F>
impl<K, T, F> AsyncPoolRegistry<K, T, F>
Sourcepub fn new<Fun>(factory_for: Fun, config: PoolConfig) -> Self
pub fn new<Fun>(factory_for: Fun, config: PoolConfig) -> Self
Builds a registry. factory_for makes the factory for a given key; config is shared.
Sourcepub fn with_clock(self, clock: Arc<dyn Clock>) -> Self
pub fn with_clock(self, clock: Arc<dyn Clock>) -> Self
Shares clock with every pool the registry creates.
Sourcepub fn with_listeners(self, listeners: Vec<Arc<dyn PoolListener<T>>>) -> Self
pub fn with_listeners(self, listeners: Vec<Arc<dyn PoolListener<T>>>) -> Self
Shares listeners with every pool the registry creates.
Auto Trait Implementations§
impl<K, T, F> !Freeze for AsyncPoolRegistry<K, T, F>
impl<K, T, F> !RefUnwindSafe for AsyncPoolRegistry<K, T, F>
impl<K, T, F> !UnwindSafe for AsyncPoolRegistry<K, T, F>
impl<K, T, F> Send for AsyncPoolRegistry<K, T, F>
impl<K, T, F> Sync for AsyncPoolRegistry<K, T, F>
impl<K, T, F> Unpin for AsyncPoolRegistry<K, T, F>
impl<K, T, F> UnsafeUnpin for AsyncPoolRegistry<K, T, F>where
Box<dyn Fn(&K) -> F + Send + Sync>: UnsafeUnpin,
Vec<Arc<dyn PoolListener<T>>>: UnsafeUnpin,
Mutex<RegState<K, T, F>>: 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