Skip to main content

Scope

Trait Scope 

Source
pub trait Scope<'s, 'env, 'scope>: Copy {
    // Required method
    fn run<W>(self, work: W)
       where W: FnOnce() + Send + 'scope + 'env,
             'scope: 's,
             'env: 'scope + 's;
}
Expand description

A scope within which work can be spawned onto a ThreadPool, bounded by the lifetimes of the borrowed environment.

Required Methods§

Source

fn run<W>(self, work: W)
where W: FnOnce() + Send + 'scope + 'env, 'scope: 's, 'env: 'scope + 's,

Runs work within this scope on a worker thread of the pool this scope is created from.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'s, 'env, 'scope> Scope<'s, 'env, 'scope> for &'s Scope<'s, 'env>

Source§

fn run<W>(self, work: W)
where W: FnOnce() + Send + 'scope + 'env, 'scope: 's, 'env: 'scope + 's,

Source§

impl<'s, 'env, 'scope> Scope<'s, 'env, 'scope> for &'s Scope<'scope>

Source§

fn run<W>(self, work: W)
where W: FnOnce() + Send + 'scope + 'env, 'scope: 's, 'env: 'scope + 's,

Implementors§