pub struct Petting {}Expand description
Provides the concrete implementation for “petting” a system watchdog.
This struct doesn’t hold any state; its purpose is to implement the PettingTrait
for writing heartbeat messages to a watchdog file.
Implementations§
Trait Implementations§
Source§impl PettingTrait for Petting
impl PettingTrait for Petting
Source§fn pet(&mut self, watchdog_filename: &str, watchdog_heartbeat: &str)
fn pet(&mut self, watchdog_filename: &str, watchdog_heartbeat: &str)
Writes the heartbeat message to the specified watchdog file.
This concrete implementation of pet uses std::fs::write to write the
watchdog_heartbeat string to the watchdog_filename. The result of the
file write operation is intentionally ignored, as the system watchdog
typically performs its own checks to determine if the heartbeat was received.
§Arguments
watchdog_filename- The path to the watchdog file.watchdog_heartbeat- The string message to write as the heartbeat.
Auto Trait Implementations§
impl Freeze for Petting
impl RefUnwindSafe for Petting
impl Send for Petting
impl Sync for Petting
impl Unpin for Petting
impl UnwindSafe for Petting
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