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.mdhas the full contract. - spawn
- Autostart:
connect_or_spawn,connect_or_spawn_with,SpawnError
Structs§
- Client
- A live connection to the daemon.
- Event
Stream - Live bus events for one
crate::Client::subscribecall. - Lagged
- The local
broadcast::Receiverbehind anEventStreamfell behind and discarded events before this stream could read them. - Reconnecting
Client - A
Clientthat re-establishes its own connection when the daemon it was talking to is replaced. - SshOptions
- How
Client::connect_ssh_withruns ssh.
Enums§
- Connect
Error - Why
Connection::openfailed. - Link
Lost - Why a bounded wait on the link ended with the link still down.
- Link
State - What a
ReconnectingClient’s supervisor is currently doing. - Reconnected
- Whether a
Client::reconnectreached the daemon it was talking to before, or a different one. - Request
Error - Why a
Client::request(orClient::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::ReopenandRequest::Flush. - PROTOCOL_
VERSION - The wire protocol this client speaks, re-exported from
shep_core::protocol::PROTOCOL_VERSION. - RECONNECT_
MAX_ DELAY - The ceiling
RECONNECT_MIN_DELAYdoubles 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 overMAX_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::StopandRequest::Delete. - TRIGGER_
DEADLINE - Budget for
Request::Trigger.
Traits§
- Stream
- The trait
EventStreamimplements.