Skip to main content

Module exec

Module exec 

Source
Expand description

Exec wire types: the bodies, queries, and SSE event payloads of /v1/exec/*.

Every type here derives both halves of serde. The daemon needs only one half of each and a client needs the other, and a type that carries one half is a type the other side has to hand-write — which is the drift this crate exists to prevent. The published docs/schema.json is generated from these same attributes under both contracts, so a shape change is a schema diff rather than a surprise.

Structs§

ErrorBody
The JSON error body every failing control route returns.
ExitEvent
The terminal exit SSE event. Emitted before the stream ends, so a client that sees the body close without one knows the connection failed rather than the command finishing.
GapEvent
One gap SSE event: the byte range a lagging or late subscriber lost.
KillResponse
POST /v1/exec/{id}/kill response.
Outcome
Captured output and exit status of a finished exec.
OutputEvent
One output SSE event.
PollResponse
ProcGroup
One entry of GET /v1/procs: an exec’s process group as the daemon sees it.
ProcsResponse
GET /v1/procs response.
StartRequest
A start request. command is either an argv array or, with shell: true, a single script string.
StartResponse
StdinRequest
POST /v1/exec/{id}/stdin body.
StdinResponse
POST /v1/exec/{id}/stdin response.
StreamQuery
GET /v1/exec/{id}/stream query.

Enums§

Phase
Where an exec sits in its lifecycle. Mirrors ExecPhase in the model crate.
StreamKind
Which pipe a streamed chunk came from. Both share one offset space, so a client holds one cursor rather than two that can disagree about ordering.

Constants§

ERROR_ALREADY_ACKED
An earlier ack already released the output.
ERROR_MALFORMED_REQUEST
The body is not a valid request for this route. Always 400, never 404.
ERROR_SPAWN_FAILED
The child could not be spawned. 500, deliberately not 404.
ERROR_STDIN_CLOSED
stdin was closed by an earlier eof, or the child stopped reading. 410: a retry will never succeed.
ERROR_STDIN_NOT_REQUESTED
The exec was started without stdin: true. Fixable at start time, hence 409.
ERROR_STDIN_WRITE_FAILED
The write to the pipe failed for a reason other than a broken pipe.
ERROR_STDIN_WRITE_TIMEOUT
The child did not read within the configured window. Retryable, and some bytes may already have been written.
ERROR_STDIN_WRITE_TOO_LARGE
The decoded write exceeds the configured per-write cap.
ERROR_STILL_RUNNING
The exec has not exited, so acking would drop output still being written.
ERROR_UNKNOWN_EXEC
No exec is registered under this id, or its entry was collected after an ack.
EVENT_EXIT
EVENT_GAP
EVENT_OUTPUT
The event: names on GET /v1/exec/{id}/stream.