Skip to main content

Crate shep_client

Crate shep_client 

Source
Expand description

Async client for the shep daemon: connect-or-spawn state machine, typed wrappers for every RPC verb, and event-bus subscription streams. This is the programmatic API embedders use; the CLI is a thin consumer of it.

Re-exports shep_core so downstream users need a single dependency.

§Quick start

use shep_client::shep_core::prelude::MemSize;

let limit: MemSize = "512M".parse().unwrap();
assert_eq!(limit.bytes(), 512 << 20);

Module-by-module design: docs/systematic-refactor/refactor-workspace/map.md.

Re-exports§

pub use shep_core;

Modules§

dogs
What every dog shares: answering shep’s probes, starting up, talking to its shepherd, and stopping. docs/dogs.md has the full contract.
spawn
Autostart: connect_or_spawn, connect_or_spawn_with, SpawnError

Structs§

Client
A live connection to the daemon.
EventStream
Live bus events for one crate::Client::subscribe call.
Lagged
The local broadcast::Receiver behind an EventStream fell behind and discarded events before this stream could read them.
ReconnectingClient
A Client that re-establishes its own connection when the daemon it was talking to is replaced.
SshOptions
How Client::connect_ssh_with runs ssh.

Enums§

ConnectError
Why Connection::open failed.
LinkLost
Why a bounded wait on the link ended with the link still down.
LinkState
What a ReconnectingClient’s supervisor is currently doing.
Reconnected
Whether a Client::reconnect reached the daemon it was talking to before, or a different one.
RequestError
Why a Client::request (or Client::request_with_deadline) call failed.
SshCause
Why dialling a host through ssh failed, inside ConnectError::Ssh.

Constants§

DEADLINE_GRACE
How much longer the client waits than the deadline it asked the daemon to honour, so it doesn’t report a timeout for work that succeeded.
DEFAULT_DEADLINE
Daemon-side budget applied when a caller names none. Mirrors the daemon’s own DEFAULT_DEADLINE_MS = 5_000 (shep-daemon/src/rpc.rs).
HANDSHAKE_TIMEOUT
Budget for one connect-plus-handshake attempt.
LOG_PLANE_DEADLINE
Budget for the log-plane verbs that walk the flock file by file: Request::Reopen and Request::Flush.
PROTOCOL_VERSION
The wire protocol this client speaks, re-exported from shep_core::protocol::PROTOCOL_VERSION.
RECONNECT_MAX_DELAY
The ceiling RECONNECT_MIN_DELAY doubles up to.
RECONNECT_MIN_DELAY
How long the supervisor waits after its first failed reconnect attempt before trying again.
RELOAD_DEADLINE
Budget for Request::Reload.
START_DEADLINE
Budget for Request::Start. A cold spawn plus a readiness probe routinely outruns the 5s default, and the daemon clamps anything over MAX_DEADLINE_MS = 60_000 (shep-daemon/src/rpc.rs:38), so this is well inside what the daemon will honour.
STOP_DEADLINE
Budget for Request::Stop and Request::Delete.
TRIGGER_DEADLINE
Budget for Request::Trigger.

Traits§

Stream
The trait EventStream implements.