pub struct SuspendDetector { /* private fields */ }Expand description
Independent suspend detector for callers that run on their own timer and can’t
rely on the shared checkpoint()/GAP_LOG pair, which is only written by the
main tick loop. Two independently-scheduled tokio tasks that both freeze during a
host suspend become “due” at roughly the same instant on wake with no ordering
guarantee between them — a caller reading GAP_LOG right after wake can race the
main loop’s own checkpoint() call and observe no gap yet. A SuspendDetector
avoids the race by tracking its own Instant/wall-clock baseline, so it detects the
gap from its own frozen timer instead of waiting on another task to record it.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SuspendDetector
impl RefUnwindSafe for SuspendDetector
impl Send for SuspendDetector
impl Sync for SuspendDetector
impl Unpin for SuspendDetector
impl UnsafeUnpin for SuspendDetector
impl UnwindSafe for SuspendDetector
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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