pub struct Beacon {
pub pid: i32,
pub root: PathBuf,
pub start_time: u64,
pub status: String,
pub last_event_at: u64,
pub socket_path: Option<PathBuf>,
}Expand description
A heartbeat file written by the ixd daemon so other processes can
detect a running watcher and query its status.
Fields§
§pid: i32PID of the ixd daemon process.
root: PathBufCanonical root directory being watched.
start_time: u64Unix timestamp (seconds) when the daemon started.
status: StringHuman-readable status (e.g. "idle", "indexing").
last_event_at: u64Unix timestamp (seconds) of the last filesystem event.
socket_path: Option<PathBuf>Path to the Unix domain socket for real-time notifications.
Implementations§
Source§impl Beacon
impl Beacon
Sourcepub fn new(root: &Path) -> Self
pub fn new(root: &Path) -> Self
Create a new beacon for the current process, anchored at the given root.
Sourcepub fn is_live(&self) -> bool
pub fn is_live(&self) -> bool
Check whether the daemon described by this beacon is still running.
Verifies the recorded PID still exists, belongs to an ixd binary,
and the watched root directory is still accessible.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Beacon
impl<'de> Deserialize<'de> for Beacon
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Beacon
impl RefUnwindSafe for Beacon
impl Send for Beacon
impl Sync for Beacon
impl Unpin for Beacon
impl UnsafeUnpin for Beacon
impl UnwindSafe for Beacon
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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