Enum interruptible::Interruptibility
source · pub enum Interruptibility<'rx> {
NonInterruptible,
Interruptible {
interrupt_rx: OwnedOrMutRef<'rx, Receiver<InterruptSignal>>,
interrupt_strategy: InterruptStrategy,
},
}
Expand description
Specifies interruptibility support of the application.
This is the dynamic / non-type-parameterized version of interruptibility.
Variants§
NonInterruptible
Interruptions are not supported.
Interruptible
Fields
§
interrupt_rx: OwnedOrMutRef<'rx, Receiver<InterruptSignal>>
Channel receiver of the interrupt signal.
§
interrupt_strategy: InterruptStrategy
How to poll the underlying stream when an interruption is received.
Interruptions are supported.
Implementations§
source§impl<'rx> Interruptibility<'rx>
impl<'rx> Interruptibility<'rx>
sourcepub fn new(
interrupt_rx: OwnedOrMutRef<'rx, Receiver<InterruptSignal>>,
interrupt_strategy: InterruptStrategy
) -> Self
pub fn new( interrupt_rx: OwnedOrMutRef<'rx, Receiver<InterruptSignal>>, interrupt_strategy: InterruptStrategy ) -> Self
Returns a new Interruptibility::Interruptible
.
sourcepub fn finish_current(
interrupt_rx: OwnedOrMutRef<'rx, Receiver<InterruptSignal>>
) -> Self
pub fn finish_current( interrupt_rx: OwnedOrMutRef<'rx, Receiver<InterruptSignal>> ) -> Self
Returns a new Interruptibility::Interruptible
using the
InterruptStrategy::FinishCurrent
strategy.
sourcepub fn poll_next_n(
interrupt_rx: OwnedOrMutRef<'rx, Receiver<InterruptSignal>>,
n: u64
) -> Self
pub fn poll_next_n( interrupt_rx: OwnedOrMutRef<'rx, Receiver<InterruptSignal>>, n: u64 ) -> Self
Returns a new Interruptibility::Interruptible
using the
InterruptStrategy::FinishCurrent
strategy.
sourcepub fn reborrow(&mut self) -> Interruptibility<'_>
pub fn reborrow(&mut self) -> Interruptibility<'_>
Reborrows this Interruptibility
with a shorter lifetime.
sourcepub fn interrupt_strategy(&self) -> Option<InterruptStrategy>
pub fn interrupt_strategy(&self) -> Option<InterruptStrategy>
Returns the InterruptStrategy
if present.
Trait Implementations§
source§impl<'rx> Debug for Interruptibility<'rx>
impl<'rx> Debug for Interruptibility<'rx>
source§impl<'rx> From<Interruptibility<'rx>> for InterruptibilityState<'rx, 'static>
impl<'rx> From<Interruptibility<'rx>> for InterruptibilityState<'rx, 'static>
source§fn from(interruptibility: Interruptibility<'rx>) -> Self
fn from(interruptibility: Interruptibility<'rx>) -> Self
Returns a new InterruptibilityState
.
Auto Trait Implementations§
impl<'rx> !RefUnwindSafe for Interruptibility<'rx>
impl<'rx> Send for Interruptibility<'rx>
impl<'rx> Sync for Interruptibility<'rx>
impl<'rx> Unpin for Interruptibility<'rx>
impl<'rx> !UnwindSafe for Interruptibility<'rx>
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