Expand description
The framed stdin/stdout protocol between the runner and a worker.
One frame is a four-byte big-endian length prefix followed by exactly that many bytes of one UTF-8 JSON value. The same frame format runs both directions. The declared length is checked against a limit before any allocation, so an oversized declaration is refused without buying its buffer. EOF inside the header or the payload is a truncated frame, the footprint of a killed writer, and never parses.
A response frame alone is not success. The runner also requires a clean child exit and no trailing stdout bytes, so a worker that crashes after writing plausible JSON, or logs past its frame, is refused.
Modules§
- bodies
- Typed request and response bodies for the shipped adapters. Each
adapter’s
payloadandokvalues are these shapes.
Structs§
- Request
- One request frame from the runner to a worker.
- Request
Schema - A schema field pinned to one literal value. Serializes to that literal and rejects every other value on read.
- Response
- One response frame from a worker to the runner.
- Response
Schema - A schema field pinned to one literal value. Serializes to that literal and rejects every other value on read.
- Wire
Error - A machine-readable failure carried over the wire.
Enums§
- Frame
Read - How reading one frame ended.
- Response
Validation Error - Why a response violates the one-body wire shape.
Constants§
- MAX_
REQUEST_ BYTES - Ceiling on request frame payload bytes, enforced by the worker before allocation. Requests carry paths and options, never file content, so they stay small.
- REQUEST_
SCHEMA - The schema identifier carried by every adapter request.
- RESPONSE_
SCHEMA - The schema identifier carried by every adapter response.
Functions§
- read_
frame - Reads one length-prefixed frame, checking the declared length
against
max_bytesbefore allocating. - write_
frame - Writes one value as one frame and flushes.