Expand description
vane management protocol: vane-specific verb schemas plus
re-exports of the project-agnostic NDJSON-RPC framing
(ndjson_rpc).
See spec/crates/mgmt.md.
Modules§
- client
- Typed Unix-socket client. Same frame shapes as
crate::server. One Unix-socket connection per call: the API stays a simplecall(verb, args) -> result, and a future multiplexed transport can be slotted in without changing the call shape. - http_
client - HTTP-over-TCP management client. Mirrors
crate::UnixMgmtClientbut talks tocrate::http_serveroverhyper::client::conn::http1. - http_
server - HTTP-over-TCP transport for the same NDJSON frame shapes the Unix
socket
crate::serverspeaks. - protocol
- Wire format: line-delimited JSON over a duplex byte stream. Each
request is one JSON object on one line; each response is one JSON
object on one line; lines end with
\n. No length prefix — the framing is the newline. NDJSON keeps tools such asnc -Upiped throughjqusable for ad-hoc poking. The same frame shapes ride the HTTP-over-TCP transport (NDJSON over chunked encoding). - server
- Unix-socket accept loop + per-connection line-delimited JSON
dispatch to verb handlers. The HTTP-over-TCP transport
(
crate::http_server) speaks the same frame shapes, so dispatch logic is shared. - verb
- Per-verb argument and result schemas. Wire-side
Request.argsis aserde_json::Value(untyped on the wire); each verb’s handler deserialises it into its own typed struct, surfacingcrate::protocol::WireErrorKind::BadArgson shape mismatch.
Structs§
- EndMarker
- Empty marker payload for the
Endoutcome. Encoded as{}so future fields (e.g. a final summary) can be added without breaking the wire shape. - Http
Mgmt Client - Plaintext HTTP/1.1 mgmt client. Cheap to clone —
addrisCopy,tokenis reference-counted. - Http
Server Config - Request
- Client → server frame.
- Response
- Server → client frame.
- Unix
Mgmt Client - Single-shot typed Unix mgmt client. Each
callopens a fresh connection. Re-using one client for many calls works too — the struct holds no persistent state across invocations. - Wire
Error - Structured error frame.
messageis a human-readable summary;details, when present, carries verb-specific structured context (compile error site, timeout stage, etc.) that the CLI can render alongside the message.
Enums§
- Dispatch
Outcome - What
dispatchreturns. One-shot verbs (ping,stats, …) produce a single result/error frame; streaming verbs (tail_flow) produce a sequence ofEventframes terminated by anEndframe. - Http
Server Error - Mgmt
Client Error - Response
Outcome - Successful result or structured error. Flattened into
Responseso the wire shape is{"id":N,"result":{...}}or{"id":N,"error":{...}}rather than a nestedoutcomekey. - Wire
Error Kind - Error category. The full string message carries detail; the kind is the machine-readable discriminator.
Traits§
- Event
Stream - A streaming event source. The server polls
next_eventuntil the client disconnects or the stream returnsNone. - Handler
- Server-side dispatcher. Callers implement this against their own
application state and pass an
Arc<H>tospawn_unix_serverorcrate::spawn_http_server.
Functions§
- encode_
line - Encode a value as JSON and append
\n. Centralises framing so server.rs / client.rs share one implementation. - spawn_
http_ server - Spawn one accept loop per bind address. Returns the spawned task
handles; each task runs until
cancelfires or the listener errors fatally. - spawn_
unix_ server - Bind a Unix socket and serve mgmt requests until
cancelfires.