pub struct Scope<'scope> { /* private fields */ }
Expand description
A scope represents a bunch of jobs that must be finished if this scope is dropped.
Implementations§
source§impl<'scope> Scope<'scope>
impl<'scope> Scope<'scope>
sourcepub fn execute<F>(&self, job: F)
pub fn execute<F>(&self, job: F)
Add a job to this scope.
Subsequent calls to join
will wait for this job to complete.
sourcepub fn recurse<F>(&self, job: F)
pub fn recurse<F>(&self, job: F)
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.
Trait Implementations§
Auto Trait Implementations§
impl<'scope> Freeze for Scope<'scope>
impl<'scope> RefUnwindSafe for Scope<'scope>
impl<'scope> Unpin for Scope<'scope>
impl<'scope> UnwindSafe for Scope<'scope>
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