Skip to main content

with_cancel

Function with_cancel 

Source
pub fn with_cancel(parent: &Context) -> (Context, CancelFn)
Expand description

Return a child context and a cancel function.

Calling cancel.cancel() (or dropping the last clone of it) cancels the returned Context and all of its descendants. Cancellation also fires if the parent is cancelled first.