Struct yastl::Scope [−][src]
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]
F: FnOnce() + Send + 'scope,
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]
F: FnOnce(&Self) + Send + 'scope,
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]
F: FnOnce(&Scope<'smaller>) -> R,
'scope: 'smaller,
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,