pub struct BoundedWorkers<State> { /* private fields */ }Expand description
Each worker retains one state. All workers dequeue from the same bounded channel, so work is never stranded behind a busy worker’s private queue.
Implementations§
Source§impl<State: Send + 'static> BoundedWorkers<State>
impl<State: Send + 'static> BoundedWorkers<State>
Sourcepub fn start(
states: Vec<State>,
capacity: NonZeroUsize,
name: &str,
) -> Result<Self>
pub fn start( states: Vec<State>, capacity: NonZeroUsize, name: &str, ) -> Result<Self>
Start all workers before returning a capability that can admit work.
Trait Implementations§
Auto Trait Implementations§
impl<State> Freeze for BoundedWorkers<State>
impl<State> !RefUnwindSafe for BoundedWorkers<State>
impl<State> Send for BoundedWorkers<State>
impl<State> Sync for BoundedWorkers<State>
impl<State> Unpin for BoundedWorkers<State>
impl<State> UnsafeUnpin for BoundedWorkers<State>
impl<State> !UnwindSafe for BoundedWorkers<State>
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