pub trait InterruptibleFutureExt<'rx, B, T> {
// Required methods
fn interruptible_control(
self,
interrupt_rx: &'rx mut Receiver<InterruptSignal>
) -> InterruptibleFutureControl<'rx, B, T, Self> ⓘ
where Self: Sized + Future<Output = ControlFlow<B, T>>,
B: From<(T, InterruptSignal)>;
fn interruptible_result(
self,
interrupt_rx: &'rx mut Receiver<InterruptSignal>
) -> InterruptibleFutureResult<'rx, T, B, Self> ⓘ
where Self: Sized + Future<Output = Result<T, B>>;
}
Expand description
Provides the .interruptible_control()
and .interruptible_result()
methods for Future
s to return ControlFlow::Break
or Result::Err
when an interrupt signal is received.
Required Methods§
sourcefn interruptible_control(
self,
interrupt_rx: &'rx mut Receiver<InterruptSignal>
) -> InterruptibleFutureControl<'rx, B, T, Self> ⓘ
fn interruptible_control( self, interrupt_rx: &'rx mut Receiver<InterruptSignal> ) -> InterruptibleFutureControl<'rx, B, T, Self> ⓘ
Overrides this Future
’s control flow when an interrupt signal is
received.
Parameters
interrupt_rx
: Channel receiver of the interrupt signal.
sourcefn interruptible_result(
self,
interrupt_rx: &'rx mut Receiver<InterruptSignal>
) -> InterruptibleFutureResult<'rx, T, B, Self> ⓘ
fn interruptible_result( self, interrupt_rx: &'rx mut Receiver<InterruptSignal> ) -> InterruptibleFutureResult<'rx, T, B, Self> ⓘ
Overrides this Future
’s result when an interrupt signal is received.
Parameters
interrupt_rx
: Channel receiver of the interrupt signal.