pub struct InterruptHandle { /* private fields */ }Expand description
Cooperative interrupt signal shared between the SLYNK reader task (which
interrupt()s on (:emacs-interrupt)) and the eval task. Backed by a
monotonic generation counter rather than a boolean latch: an interrupt
increments the count, and a request asks “did the count move since I
started?” via InterruptHandle::generation + [InterruptHandle::is_interrupted_since].
The generation design is deliberate (a prior boolean latch was racy): there is no shared flag to leave set, so an interrupt can never “stick” and poison an unrelated later request. Each top-level operation snapshots the generation at entry and compares against it; the next operation re-snapshots, automatically discarding any interrupt that targeted the finished one — no per-exit cleanup needed, on any terminal path.
Implementations§
Trait Implementations§
Source§impl Clone for InterruptHandle
impl Clone for InterruptHandle
Source§fn clone(&self) -> InterruptHandle
fn clone(&self) -> InterruptHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InterruptHandle
impl Debug for InterruptHandle
Source§impl Default for InterruptHandle
impl Default for InterruptHandle
Source§fn default() -> InterruptHandle
fn default() -> InterruptHandle
Auto Trait Implementations§
impl Freeze for InterruptHandle
impl RefUnwindSafe for InterruptHandle
impl Send for InterruptHandle
impl Sync for InterruptHandle
impl Unpin for InterruptHandle
impl UnsafeUnpin for InterruptHandle
impl UnwindSafe for InterruptHandle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more