Expand description
Framed stdio transport for bytes-only named component contracts.
An executable stays alive for its component’s lifetime. Stdin and stdout carry only frames:
a four-byte little-endian unsigned JSON byte length, followed by that JSON. Stderr is
inherited for diagnostics. Frames are bounded by MAX_FRAME_SIZE. Calls are serialized
across all contracts sharing the executable. A timeout or protocol failure terminates and
reaps the child; producer status failures leave the connection usable.
The first request is {"op":"describe"}. Its successful response payload contains JSON
matching StdioDescriptor, checked against the verified artifact’s manifest. Subsequent
requests use {"op":"call","contract":"name","method":"name","payload":[0,255]}.
Every response is {"status":0,"payload":[0,255]}. Status codes use AlefStatus semantics;
a nonzero status carries error message bytes. Payloads are JSON byte arrays, not base64.
This transport supports crate::LoadedComponent::invoke_bytes. Arbitrary generated C
function tables cannot be represented across a process boundary: typed table access and
typed instance creation return an explicit unsupported-transport error.
Structs§
- Stdio
Descriptor - Metadata returned as JSON inside the successful
describeresponse payload. - Stdio
Response - A response envelope, using the component ABI’s integer status codes.
Enums§
- Stdio
Request - A request envelope. A producer must answer exactly once for every request.
Constants§
Functions§
- read_
frame - Read one complete bounded frame. EOF, including between frames, is an error.
- write_
frame - Write and flush one bounded frame.