pub struct DaemonClient { /* private fields */ }Implementations§
Source§impl DaemonClient
impl DaemonClient
pub async fn discover( paths: &RuntimePaths, configured_port: u16, client_version: &str, ) -> Result<Self, DaemonClientError>
pub async fn connect( endpoint: DaemonEndpoint, paths: &RuntimePaths, ) -> Result<Self, DaemonClientError>
pub async fn list_services(&self) -> Result<ServiceDiscovery, DaemonClientError>
pub async fn start_service( &self, name: &str, ) -> Result<ServiceRuntimeStatus, DaemonClientError>
pub async fn stop_service( &self, name: &str, ) -> Result<ServiceRuntimeStatus, DaemonClientError>
pub async fn restart_service( &self, name: &str, ) -> Result<ServiceRuntimeStatus, DaemonClientError>
Sourcepub async fn status(
&self,
) -> Result<Vec<ServiceRuntimeStatus>, DaemonClientError>
pub async fn status( &self, ) -> Result<Vec<ServiceRuntimeStatus>, DaemonClientError>
Every service the daemon is tracking, however it was started.
Sourcepub async fn logs(
&self,
name: &str,
lines: u32,
) -> Result<Vec<ServiceLogEntry>, DaemonClientError>
pub async fn logs( &self, name: &str, lines: u32, ) -> Result<Vec<ServiceLogEntry>, DaemonClientError>
The tail of a service’s buffered output, newest last.
Sourcepub async fn timeline(
&self,
limit: u32,
) -> Result<Vec<TimelineEvent>, DaemonClientError>
pub async fn timeline( &self, limit: u32, ) -> Result<Vec<TimelineEvent>, DaemonClientError>
The most recent timeline events, oldest last.
pub async fn start_bundle( &self, name: &str, ) -> Result<Vec<ServiceRuntimeStatus>, DaemonClientError>
pub async fn stop_bundle( &self, name: &str, ) -> Result<Vec<ServiceRuntimeStatus>, DaemonClientError>
Sourcepub async fn list_errors(
&self,
limit: u32,
) -> Result<Vec<Incident>, DaemonClientError>
pub async fn list_errors( &self, limit: u32, ) -> Result<Vec<Incident>, DaemonClientError>
The incidents the daemon’s inbox is holding, most recently active first.
Sourcepub async fn error_prompt(
&self,
id: u64,
) -> Result<Option<IncidentPromptEnvelope>, DaemonClientError>
pub async fn error_prompt( &self, id: u64, ) -> Result<Option<IncidentPromptEnvelope>, DaemonClientError>
The debugging prompt for one incident. A 404 is not a transport failure
— it is the daemon saying it holds no such incident — so it comes back
as None rather than as an error.
Sourcepub async fn shutdown(&self) -> Result<(), DaemonClientError>
pub async fn shutdown(&self) -> Result<(), DaemonClientError>
Ask the daemon to stop itself, and with it every service on the machine.
The daemon answers before it is down — draining takes as long as the services take to stop — so a caller that needs the port free has to watch for it rather than trust this returning.
Sourcepub async fn list_terminal_sessions(
&self,
) -> Result<Vec<TerminalSessionInfo>, DaemonClientError>
pub async fn list_terminal_sessions( &self, ) -> Result<Vec<TerminalSessionInfo>, DaemonClientError>
The terminal tabs the daemon owns, in the order they were created.
Sourcepub async fn open_terminal(
&self,
id: &str,
) -> Result<TerminalSessionInfo, DaemonClientError>
pub async fn open_terminal( &self, id: &str, ) -> Result<TerminalSessionInfo, DaemonClientError>
Move a running agent session out to the system terminal.
Sourcepub async fn reclaim_terminal(
&self,
id: &str,
) -> Result<TerminalSessionInfo, DaemonClientError>
pub async fn reclaim_terminal( &self, id: &str, ) -> Result<TerminalSessionInfo, DaemonClientError>
Bring one back to the dock.
Sourcepub async fn service_action_value(
&self,
name: &str,
action: ServiceAction,
) -> Result<Value, DaemonClientError>
pub async fn service_action_value( &self, name: &str, action: ServiceAction, ) -> Result<Value, DaemonClientError>
A service mutation’s status field exactly as the daemon sent it —
same key order, and explicit nulls kept.
ServiceRuntimeStatus cannot carry either. Its fields are declared
in the order this crate found convenient, and skip_serializing_if
turns an explicit "exitCode": null into an absent key on the way
back out. Both are fine for a caller that reads fields; neither is fine
for the CLI, which prints the document. A process killed by a signal
reports exitCode: null and no code, and dropping the key changes what
nomoreide stop <service> | jq .exitCode answers from null to
nothing at all.
Sourcepub async fn bundle_action_value(
&self,
name: &str,
action: ServiceAction,
) -> Result<Value, DaemonClientError>
pub async fn bundle_action_value( &self, name: &str, action: ServiceAction, ) -> Result<Value, DaemonClientError>
The same, for a bundle mutation’s statuses array.
Trait Implementations§
Source§impl Clone for DaemonClient
impl Clone for DaemonClient
Source§fn clone(&self) -> DaemonClient
fn clone(&self) -> DaemonClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more