pub struct KeyedWorkerPool<K: WorkerKey, W: KeyedWorker<K>, F: KeyedWorkerFactory<K, W>> { /* private fields */ }Implementations§
Source§impl<K: WorkerKey, W: KeyedWorker<K>, F: KeyedWorkerFactory<K, W>> KeyedWorkerPool<K, W, F>
impl<K: WorkerKey, W: KeyedWorker<K>, F: KeyedWorkerFactory<K, W>> KeyedWorkerPool<K, W, F>
Sourcepub fn new(
factory: F,
config: KeyedWorkerPoolConfig,
) -> KeyedWorkerPoolRef<K, W, F>
pub fn new( factory: F, config: KeyedWorkerPoolConfig, ) -> KeyedWorkerPoolRef<K, W, F>
Creates a keyed worker pool with explicit per-key configuration.
pub fn cleanup_idle_worker(&self) -> usize
pub async fn get_worker( self: &KeyedWorkerPoolRef<K, W, F>, key: K, ) -> PoolResult<KeyedWorkerGuard<K, W, F>>
pub async fn clear_all_worker(&self)
Auto Trait Implementations§
impl<K, W, F> !Freeze for KeyedWorkerPool<K, W, F>
impl<K, W, F> RefUnwindSafe for KeyedWorkerPool<K, W, F>where
F: RefUnwindSafe,
impl<K, W, F> Send for KeyedWorkerPool<K, W, F>
impl<K, W, F> Sync for KeyedWorkerPool<K, W, F>
impl<K, W, F> Unpin for KeyedWorkerPool<K, W, F>
impl<K, W, F> UnsafeUnpin for KeyedWorkerPool<K, W, F>
impl<K, W, F> UnwindSafe for KeyedWorkerPool<K, W, F>where
F: RefUnwindSafe,
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