pub struct PoolScope<'a, P: ThreadPool> { /* private fields */ }Expand description
Scoped execution context for a thread pool.
This provides a convenient way to run operations with a specific thread pool.
Implementations§
Source§impl<'a, P: ThreadPool> PoolScope<'a, P>
impl<'a, P: ThreadPool> PoolScope<'a, P>
Sourcepub fn with_threshold(pool: &'a P, threshold: ParThreshold) -> Self
pub fn with_threshold(pool: &'a P, threshold: ParThreshold) -> Self
Creates a new pool scope with a custom threshold.
Sourcepub fn num_threads(&self) -> usize
pub fn num_threads(&self) -> usize
Returns the number of threads in the pool.
Sourcepub fn for_each_range<F>(&self, total: usize, f: F)
pub fn for_each_range<F>(&self, total: usize, f: F)
Parallel for_each over work ranges.
Auto Trait Implementations§
impl<'a, P> Freeze for PoolScope<'a, P>
impl<'a, P> RefUnwindSafe for PoolScope<'a, P>where
P: RefUnwindSafe,
impl<'a, P> Send for PoolScope<'a, P>
impl<'a, P> Sync for PoolScope<'a, P>
impl<'a, P> Unpin for PoolScope<'a, P>
impl<'a, P> UnwindSafe for PoolScope<'a, P>where
P: 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