orx-parallel 4.0.0

Performant parallel computations with an expressive iterator API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
/// A scope within which work can be spawned onto a [`ThreadPool`], bounded by the
/// lifetimes of the borrowed environment.
///
/// [`ThreadPool`]: crate::ThreadPool
pub trait Scope<'s, 'env, 'scope>: Copy {
    /// Runs `work` within this scope on a worker thread of the pool this
    /// scope is created from.
    fn run<W>(self, work: W)
    where
        'scope: 's,
        'env: 'scope + 's,
        W: FnOnce() + Send + 'scope + 'env;
}