pub struct Pool { /* private fields */ }Expand description
A fixed set of worker threads that Exec tokens place work on.
Pool is the only way to make a pool. It wraps the scheduler privately: no
scheduler type appears in any signature, there is no constructor from an
external pool and no accessor returning one. The pool’s owner keeps the
Pool and mints tokens from it with Exec::new.
Dropping a Pool shuts its workers down.
§Examples
use strided_exec::Pool;
let pool = Pool::builder().threads(2).thread_name(|i| format!("w{i}")).build()?;
assert!(pool.width().get() <= 2);Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pool
impl RefUnwindSafe for Pool
impl Send for Pool
impl Sync for Pool
impl Unpin for Pool
impl UnsafeUnpin for Pool
impl UnwindSafe for Pool
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