Trait wait_list::CancelCallback
source · [−]pub trait CancelCallback<'wait_list, L: Lock, I, O>: Sized {
fn on_cancel(self, list: LockedExclusive<'wait_list, L, I, O>, output: O);
}Expand description
A callback that is called in the event that the future has been woken but was cancelled before it could complete.
This trait is implemented for all functions and closures that accept a
LockedExclusive<'wait_list, L, I, O> and an O, but is also available as a separate trait so
you can implement it on concrete types.
Required Methods
fn on_cancel(self, list: LockedExclusive<'wait_list, L, I, O>, output: O)
fn on_cancel(self, list: LockedExclusive<'wait_list, L, I, O>, output: O)
Called when the future has been woken but was cancelled before it could complete.
It is given an exclusive lock to the associated WaitList as well as the output value
that was not yielded by the future.