pub struct KeepAlive { /* private fields */ }Expand description
Tracker the listener pokes on every successful frame receive. Cheap to
clone (Arc<Mutex<...>>); listener and watcher hold one each.
Implementations§
Source§impl KeepAlive
impl KeepAlive
Sourcepub fn new(window: Duration) -> Self
pub fn new(window: Duration) -> Self
Construct with the given window. The first frame is “now” — i.e. the watcher does not fire on a cell that just booted.
Sourcepub async fn notify_frame(&self)
pub async fn notify_frame(&self)
Reset on every successful frame receive.
Sourcepub async fn is_silenced(&self) -> bool
pub async fn is_silenced(&self) -> bool
True iff the elapsed time since the last frame exceeds the window.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeepAlive
impl !RefUnwindSafe for KeepAlive
impl Send for KeepAlive
impl Sync for KeepAlive
impl Unpin for KeepAlive
impl UnsafeUnpin for KeepAlive
impl !UnwindSafe for KeepAlive
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