pub struct DaemonClient { /* private fields */ }Expand description
A one-shot client over the daemon’s Unix-domain control socket. Each call
opens a fresh connection, sends one DaemonEnvelope, and reads one
DaemonReply.
Implementations§
Source§impl DaemonClient
impl DaemonClient
Sourcepub fn new(socket_path: impl Into<PathBuf>) -> Self
pub fn new(socket_path: impl Into<PathBuf>) -> Self
Creates a client targeting the socket at socket_path.
Sourcepub fn socket_path(&self) -> &Path
pub fn socket_path(&self) -> &Path
The socket path this client targets.
Sourcepub async fn request(&self, envelope: DaemonEnvelope) -> Result<DaemonReply>
pub async fn request(&self, envelope: DaemonEnvelope) -> Result<DaemonReply>
Sends one envelope and returns the daemon’s reply.
Sourcepub async fn ping(&self) -> Result<()>
pub async fn ping(&self) -> Result<()>
Probes whether a live daemon is answering on the socket.
Sourcepub async fn status(&self) -> Result<StatusReport>
pub async fn status(&self) -> Result<StatusReport>
Requests aggregated per-service status.
Trait Implementations§
Source§impl Clone for DaemonClient
impl Clone for DaemonClient
Source§fn clone(&self) -> DaemonClient
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DaemonClient
impl RefUnwindSafe for DaemonClient
impl Send for DaemonClient
impl Sync for DaemonClient
impl Unpin for DaemonClient
impl UnsafeUnpin for DaemonClient
impl UnwindSafe for DaemonClient
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