Struct StallWatchdog
pub struct StallWatchdog { /* private fields */ }Implementations§
Source§impl StallWatchdog
impl StallWatchdog
Sourcepub fn new(timeout_secs: u64) -> StallWatchdog
pub fn new(timeout_secs: u64) -> StallWatchdog
Create a new watchdog with the given stall threshold.
The watchdog is not started — call start to begin
monitoring.
Sourcepub fn touch(&self)
pub fn touch(&self)
Record that an event was received right now. This is lock-free (atomic store) and can be called from any async context without contention.
Sourcepub fn is_stalled(&self) -> bool
pub fn is_stalled(&self) -> bool
Returns true if the time since the last event exceeds the configured
timeout.
pub async fn start(&self, on_stall: impl Fn() + Send + 'static)
Trait Implementations§
Source§impl Drop for StallWatchdog
impl Drop for StallWatchdog
Auto Trait Implementations§
impl !Freeze for StallWatchdog
impl !RefUnwindSafe for StallWatchdog
impl Send for StallWatchdog
impl Sync for StallWatchdog
impl Unpin for StallWatchdog
impl UnsafeUnpin for StallWatchdog
impl UnwindSafe for StallWatchdog
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
§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>
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