Struct Interrupt
pub struct Interrupt { /* private fields */ }Expand description
A deadline and/or a cancel flag. Interrupt::default() never triggers.
Implementations§
§impl Interrupt
impl Interrupt
pub fn with_flag(self, flag: Arc<Atomic<bool>>) -> Interrupt
pub fn with_flag(self, flag: Arc<Atomic<bool>>) -> Interrupt
Also trigger when flag is set (from any thread).
pub fn with_deadline(self, deadline: Instant) -> Interrupt
pub fn with_deadline(self, deadline: Instant) -> Interrupt
Also trigger at deadline (replacing any earlier deadline).
pub fn deadline_passed(&self) -> bool
pub fn deadline_passed(&self) -> bool
True when a deadline is set and has passed. Lets a host that set both a deadline and a flag tell which one fired.
pub fn is_triggered(&self) -> bool
pub fn is_triggered(&self) -> bool
True when either the deadline has passed or the flag is set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Interrupt
impl RefUnwindSafe for Interrupt
impl Send for Interrupt
impl Sync for Interrupt
impl Unpin for Interrupt
impl UnsafeUnpin for Interrupt
impl UnwindSafe for Interrupt
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