pub struct DaemonLock { /* private fields */ }Expand description
RAII guard that holds the daemon PID lock file.
Why: tie the lock file’s lifetime to the daemon process lifetime so
the file is removed on both clean shutdown and panic, without
requiring every exit path to call an explicit cleanup function. The
guard is not Clone or Send — it is constructed once in main and
lives for the full daemon lifetime.
What: wraps the path of the written lock file. Drop removes it
best-effort (I/O errors are silently swallowed — the file will be
reclaimed as stale by the next invocation anyway).
Test: daemon_lock_drops_removes_file.
Trait Implementations§
Source§impl Debug for DaemonLock
impl Debug for DaemonLock
Source§impl Drop for DaemonLock
impl Drop for DaemonLock
Auto Trait Implementations§
impl Freeze for DaemonLock
impl RefUnwindSafe for DaemonLock
impl Send for DaemonLock
impl Sync for DaemonLock
impl Unpin for DaemonLock
impl UnsafeUnpin for DaemonLock
impl UnwindSafe for DaemonLock
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