pub struct DaemonClient { /* private fields */ }Implementations§
Source§impl DaemonClient
impl DaemonClient
Sourcepub fn ensure() -> Result<Self, DaemonError>
pub fn ensure() -> Result<Self, DaemonError>
Connect, spawning the daemon if nothing answers. Resolves the CLI
binary via resolve_daemon_bin (never assumes current_exe is the
CLI). Restarts an older daemon only when this process is the CLI.
Sourcepub fn ensure_resolved(
paths: &Paths,
proxy_port: TcpPort,
role: DaemonRole,
) -> Result<Self, DaemonError>
pub fn ensure_resolved( paths: &Paths, proxy_port: TcpPort, role: DaemonRole, ) -> Result<Self, DaemonError>
Like Self::ensure, but with an injectable state layout and proxy
port. Resolves the CLI binary only when a spawn (or CLI self-upgrade)
is required — an already-running daemon (e.g. hermetic TestContext)
does not need stackless on PATH.
Sourcepub fn ensure_with(
paths: &Paths,
executable: &Path,
proxy_port: TcpPort,
role: DaemonRole,
) -> Result<Self, DaemonError>
pub fn ensure_with( paths: &Paths, executable: &Path, proxy_port: TcpPort, role: DaemonRole, ) -> Result<Self, DaemonError>
Like Self::ensure, but uses an injectable state layout, proxy
port, daemon binary, and DaemonRole instead of process-global
defaults. Embedded spawns pass --state-dir / --proxy-port /
--embedded so the child binds the same layout the client waits on.
Version kill-and-replace is disabled for this entry point (source
ResolveSource::Explicit): hermetic tests inject CARGO_BIN_EXE
and must not thrash a mismatched operator daemon.
pub fn connect() -> Result<Self, DaemonError>
pub fn connect_with(paths: &Paths) -> Result<Self, DaemonError>
Sourcepub fn ping(&mut self) -> Result<String, DaemonError>
pub fn ping(&mut self) -> Result<String, DaemonError>
Returns the daemon’s version.