Struct yastl::Scope[][src]

pub struct Scope<'scope> { /* fields omitted */ }

A scope represents a bunch of jobs that must be finished if this scope is dropped.

Implementations

impl<'scope> Scope<'scope>[src]

pub fn forever(pool: Pool) -> Scope<'static>[src]

Create a Scope which lasts forever.

pub fn execute<F>(&self, job: F) where
    F: FnOnce() + Send + 'scope, 
[src]

Add a job to this scope.

Subsequent calls to join will wait for this job to complete.

pub fn recurse<F>(&self, job: F) where
    F: FnOnce(&Self) + Send + 'scope, 
[src]

Add a job to this scope, which will also get access to this scope and thus can spawn more jobs that belong to this scope.

pub fn join(&self)[src]

Awaits all jobs submitted on this Scope to be completed.

Only guaranteed to join jobs which where executed logically prior to join. Jobs executed concurrently with join may or may not be completed before join returns.

pub fn zoom<'smaller, F, R>(&self, job: F) -> R where
    F: FnOnce(&Scope<'smaller>) -> R,
    'scope: 'smaller, 
[src]

Create a new subscope, bound to a lifetime smaller than our existing Scope.

The subscope has a different job set, and is joined before zoom returns.

Trait Implementations

impl Send for Scope<'_>[src]

impl Sync for Scope<'_>[src]

Auto Trait Implementations

impl<'scope> !RefUnwindSafe for Scope<'scope>

impl<'scope> Unpin for Scope<'scope>

impl<'scope> !UnwindSafe for Scope<'scope>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.