pub struct KeepaliveHandle { /* private fields */ }Expand description
Drop-to-stop handle for a background keepalive task.
Dropping the handle sends the shutdown signal via the Drop impl,
so a forgotten _handle won’t keep tickling forever. The spawned
task observes the signal on its next tick — a pending tickle
request can still be in flight when the runtime shuts down.
Prefer KeepaliveHandle::stop when you need a clean, awaited
exit (e.g. on SIGTERM in a long-running binary).
Implementations§
Trait Implementations§
Source§impl Debug for KeepaliveHandle
impl Debug for KeepaliveHandle
Source§impl Drop for KeepaliveHandle
impl Drop for KeepaliveHandle
Source§fn drop(&mut self)
fn drop(&mut self)
Send the shutdown signal so a forgotten handle doesn’t keep
tickling forever. The spawned task observes the signal on its
next tick — for a clean awaited exit use KeepaliveHandle::stop.
We can’t .await here (sync Drop), so any in-flight tickle
finishes detached.
Auto Trait Implementations§
impl Freeze for KeepaliveHandle
impl !RefUnwindSafe for KeepaliveHandle
impl Send for KeepaliveHandle
impl Sync for KeepaliveHandle
impl Unpin for KeepaliveHandle
impl UnsafeUnpin for KeepaliveHandle
impl !UnwindSafe for KeepaliveHandle
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