Skip to main content

Module local_stream

Module local_stream 

Source
Expand description

Length-prefixed local-stream framing for later named-pipe / UDS backends.

No OS handles. windows.rs and unix.rs implement StreamBytes and wrap FramedStream. Profile is existing BearerProfile::LocalIpcV1.

Structs§

FramedStream
Connected length-prefixed stream. Partial writes stay in WriteCursor.
ReadCursor
Partial-read assembly. Oversize length poisons the cursor; a short out after a complete frame is QdnfError::Capacity and does not drop it.
UnixIpcListener
Parent-owned Unix listener. Generates a private temp dir and socket path.
UnixStreamBytes
Non-blocking Unix stream. Implements StreamBytes for FramedStream.
WriteCursor
Sealed pending write. WouldBlock retains the exact wire bytes; off advances only by accepted sink bytes.

Constants§

FRAME_CAP
Maximum payload bytes. Same value as in-process ipc.rs FRAME_CAP.
LEN_SIZE
Big-endian length prefix.
SOCKET_FILE
Socket file name under the parent-owned temp directory.
WIRE_CAP
Maximum sealed wire bytes (LEN_SIZE + FRAME_CAP).

Traits§

StreamBytes
Non-blocking byte pipe. Named-pipe and UDS adapters implement this. Ok(n) is accepted bytes; cursors advance only by that n.

Functions§

decode_stream_frame
Decode one frame. Extra bytes after the declared length are trailing (QdnfError::Malformed).
encode_stream_frame
Encode payload as u32be(len) || payload into out.
next_stream_frame
Decode one frame; leftover bytes after consumed are for the caller.