pub struct TaskPool { /* private fields */ }Expand description
A fixed-size pool of worker threads driving an unbounded set of suspended tasks.
Implementations§
Source§impl TaskPool
impl TaskPool
Sourcepub fn new(n_workers: usize) -> Self
pub fn new(n_workers: usize) -> Self
Build a pool with n_workers threads (clamped to at least 1).
Sourcepub fn worker_count(&self) -> usize
pub fn worker_count(&self) -> usize
Number of worker threads in the pool.
Auto Trait Implementations§
impl !RefUnwindSafe for TaskPool
impl !UnwindSafe for TaskPool
impl Freeze for TaskPool
impl Send for TaskPool
impl Sync for TaskPool
impl Unpin for TaskPool
impl UnsafeUnpin for TaskPool
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