Skip to main content

DaemonClient

Struct DaemonClient 

Source
pub struct DaemonClient { /* private fields */ }

Implementations§

Source§

impl DaemonClient

Source

pub async fn discover( paths: &RuntimePaths, configured_port: u16, client_version: &str, ) -> Result<Self, DaemonClientError>

Source

pub async fn connect( endpoint: DaemonEndpoint, paths: &RuntimePaths, ) -> Result<Self, DaemonClientError>

Source

pub async fn list_services(&self) -> Result<ServiceDiscovery, DaemonClientError>

Source

pub async fn start_service( &self, name: &str, ) -> Result<ServiceRuntimeStatus, DaemonClientError>

Source

pub async fn stop_service( &self, name: &str, ) -> Result<ServiceRuntimeStatus, DaemonClientError>

Source

pub async fn restart_service( &self, name: &str, ) -> Result<ServiceRuntimeStatus, DaemonClientError>

Source

pub async fn status( &self, ) -> Result<Vec<ServiceRuntimeStatus>, DaemonClientError>

Every service the daemon is tracking, however it was started.

Source

pub async fn logs( &self, name: &str, lines: u32, ) -> Result<Vec<ServiceLogEntry>, DaemonClientError>

The tail of a service’s buffered output, newest last.

Source

pub async fn timeline( &self, limit: u32, ) -> Result<Vec<TimelineEvent>, DaemonClientError>

The most recent timeline events, oldest last.

Source

pub async fn start_bundle( &self, name: &str, ) -> Result<Vec<ServiceRuntimeStatus>, DaemonClientError>

Source

pub async fn stop_bundle( &self, name: &str, ) -> Result<Vec<ServiceRuntimeStatus>, DaemonClientError>

Source

pub async fn list_errors( &self, limit: u32, ) -> Result<Vec<Incident>, DaemonClientError>

The incidents the daemon’s inbox is holding, most recently active first.

Source

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.

Source

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.

Source

pub async fn list_terminal_sessions( &self, ) -> Result<Vec<TerminalSessionInfo>, DaemonClientError>

The terminal tabs the daemon owns, in the order they were created.

Source

pub async fn open_terminal( &self, id: &str, ) -> Result<TerminalSessionInfo, DaemonClientError>

Move a running agent session out to the system terminal.

Source

pub async fn reclaim_terminal( &self, id: &str, ) -> Result<TerminalSessionInfo, DaemonClientError>

Bring one back to the dock.

Source

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.

Source

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

Source§

fn clone(&self) -> DaemonClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DaemonClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more