pub struct ExecutionContext<'a> { /* private fields */ }Expand description
Context of a task execution body.
Implementations§
Source§impl<'a> ExecutionContext<'a>
impl<'a> ExecutionContext<'a>
Sourcepub fn self_task(&self) -> RunningTask
pub fn self_task(&self) -> RunningTask
Get the running task handle of the current task.
Sourcepub fn fork<N: Into<Name>>(&self, name: N) -> ProtoTask<'_>
pub fn fork<N: Into<Name>>(&self, name: N) -> ProtoTask<'_>
Fork the current task.
The new task will block all the same dependents as the currently executing task.
This is useful because it allows creating tasks on the fly from within other tasks. Generally, making a task in flight depend on anything is impossible. But one can fork a dependency instead.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ExecutionContext<'a>
impl<'a> !RefUnwindSafe for ExecutionContext<'a>
impl<'a> Send for ExecutionContext<'a>
impl<'a> Sync for ExecutionContext<'a>
impl<'a> Unpin for ExecutionContext<'a>
impl<'a> !UnwindSafe for ExecutionContext<'a>
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