pub struct DaemonManager { /* private fields */ }Implementations§
Source§impl DaemonManager
impl DaemonManager
Sourcepub fn new(data_dir: Option<PathBuf>) -> Result<Self>
pub fn new(data_dir: Option<PathBuf>) -> Result<Self>
Create a new DaemonManager. If data_dir is None, uses the default.
Sourcepub async fn start_daemon(&self, name: &str) -> Result<DaemonInstance>
pub async fn start_daemon(&self, name: &str) -> Result<DaemonInstance>
Start a daemon by name.
Sourcepub async fn stop_daemon(
&self,
name: &str,
force: bool,
) -> Result<DaemonInstance>
pub async fn stop_daemon( &self, name: &str, force: bool, ) -> Result<DaemonInstance>
Stop a running daemon.
Sourcepub async fn restart_daemon(
&self,
name: &str,
force: bool,
) -> Result<DaemonInstance>
pub async fn restart_daemon( &self, name: &str, force: bool, ) -> Result<DaemonInstance>
Restart a daemon (stop then start).
Sourcepub async fn status(&self, name: &str) -> Result<DaemonInstance>
pub async fn status(&self, name: &str) -> Result<DaemonInstance>
Get the current status of a daemon.
Sourcepub async fn list(&self) -> Result<Vec<DaemonInstance>>
pub async fn list(&self) -> Result<Vec<DaemonInstance>>
List all daemon instances.
Sourcepub async fn add_daemon(&self, spec: DaemonSpec) -> Result<()>
pub async fn add_daemon(&self, spec: DaemonSpec) -> Result<()>
Register a new daemon spec.
Sourcepub async fn remove_daemon(&self, name: &str, force: bool) -> Result<()>
pub async fn remove_daemon(&self, name: &str, force: bool) -> Result<()>
Remove a daemon. If force is true, stop it first if running.
Sourcepub async fn get_logs(
&self,
name: &str,
lines: usize,
stderr: bool,
) -> Result<Vec<String>>
pub async fn get_logs( &self, name: &str, lines: usize, stderr: bool, ) -> Result<Vec<String>>
Read logs for a daemon.
Sourcepub async fn handle_request(self: &Arc<Self>, request: Request) -> Response
pub async fn handle_request(self: &Arc<Self>, request: Request) -> Response
Dispatch an IPC request to the appropriate method and return a response.
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
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