pub struct PondPool(/* private fields */);Expand description
A wrapper for pond::Pool and number of threads it was built with.
NOTE: The reason why pond::Pool does not directly implement ParThreadPool
is simply to be able to provide max_num_threads which is the argument used
to create the pool with.
Following constructor of the pond::Pool is made available to PondPool:
Implementations§
Source§impl PondPool
impl PondPool
Sourcepub fn new_threads_unbounded(num_threads: usize) -> Self
pub fn new_threads_unbounded(num_threads: usize) -> Self
Spawn a number of threads. The pool’s queue of pending jobs is limited. The backlog is unbounded as in unbounded.
Sourcepub fn into_inner(self) -> Pool
pub fn into_inner(self) -> Pool
Returns the wrapped pond::Pool.
Trait Implementations§
Source§impl ParThreadPool for &mut PondPool
impl ParThreadPool for &mut PondPool
Source§type ScopeRef<'s, 'env, 'scope> = Scope<'env, 'scope>
where
'scope: 's,
'env: 'scope + 's
type ScopeRef<'s, 'env, 'scope> = Scope<'env, 'scope> where 'scope: 's, 'env: 'scope + 's
Scope type of the thread pool.
Source§fn run_in_scope<'s, 'env, 'scope, W>(
s: &Self::ScopeRef<'s, 'env, 'scope>,
work: W,
)
fn run_in_scope<'s, 'env, 'scope, W>( s: &Self::ScopeRef<'s, 'env, 'scope>, work: W, )
Executes the
work within scope s.Source§fn scoped_computation<'env, 'scope, F>(&'env mut self, f: F)
fn scoped_computation<'env, 'scope, F>(&'env mut self, f: F)
Executes the scoped computation
f.Source§fn max_num_threads(&self) -> NonZeroUsize
fn max_num_threads(&self) -> NonZeroUsize
Returns the maximum number of threads available in the pool.
Source§impl ParThreadPool for PondPool
impl ParThreadPool for PondPool
Source§type ScopeRef<'s, 'env, 'scope> = Scope<'env, 'scope>
where
'scope: 's,
'env: 'scope + 's
type ScopeRef<'s, 'env, 'scope> = Scope<'env, 'scope> where 'scope: 's, 'env: 'scope + 's
Scope type of the thread pool.
Source§fn run_in_scope<'s, 'env, 'scope, W>(
s: &Self::ScopeRef<'s, 'env, 'scope>,
work: W,
)
fn run_in_scope<'s, 'env, 'scope, W>( s: &Self::ScopeRef<'s, 'env, 'scope>, work: W, )
Executes the
work within scope s.Source§fn scoped_computation<'env, 'scope, F>(&'env mut self, f: F)
fn scoped_computation<'env, 'scope, F>(&'env mut self, f: F)
Executes the scoped computation
f.Source§fn max_num_threads(&self) -> NonZeroUsize
fn max_num_threads(&self) -> NonZeroUsize
Returns the maximum number of threads available in the pool.
Auto Trait Implementations§
impl Freeze for PondPool
impl !RefUnwindSafe for PondPool
impl Send for PondPool
impl Sync for PondPool
impl Unpin for PondPool
impl !UnwindSafe for PondPool
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more