pub struct DaemonManager { /* private fields */ }Expand description
Manages the lifecycle of the bitrouter daemon process via PID-file tracking and platform-specific process control.
Implementations§
Source§impl DaemonManager
impl DaemonManager
pub fn new(paths: RuntimePaths) -> Self
Sourcepub fn is_running(&self) -> Result<Option<u32>>
pub fn is_running(&self) -> Result<Option<u32>>
Returns the PID of the running daemon, or None if it is not running.
Cleans up stale PID files when the recorded process no longer exists.
Sourcepub async fn start(&self) -> Result<u32>
pub async fn start(&self) -> Result<u32>
Spawn the daemon, returning the new PID.
Fails if the daemon is already running.
Auto Trait Implementations§
impl Freeze for DaemonManager
impl RefUnwindSafe for DaemonManager
impl Send for DaemonManager
impl Sync for DaemonManager
impl Unpin for DaemonManager
impl UnsafeUnpin for DaemonManager
impl UnwindSafe for DaemonManager
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