Expand description
Bounded length-delimited framing for streaming structured-text payloads.
A frame is a 4-byte big-endian unsigned length prefix followed by exactly
that many payload bytes. Every read is bounded by an explicit maximum so a
malformed or hostile peer can never make a reader allocate without limit.
Use this to carry one Codec-encoded value per frame over
any blocking Read/Write transport (a pipe, a socket, a subprocess’s
stdio).
write_value / read_value encode and decode typed values through an
injected codec; write_frame / read_frame move raw payload bytes when
the caller owns serialization.
Constants§
- DEFAULT_
MAX_ FRAME_ BYTES - Default maximum accepted payload size for a single frame (16 MiB).
Functions§
- decode_
value - Decode an already-read frame
payloadintoTthroughcodec. - read_
frame - Read one length-delimited frame, bounded by
max_bytes. - read_
value - Read one frame and decode it into
Tthroughcodec. - write_
frame - Write one length-delimited frame carrying
payload, flushing on completion. - write_
value - Encode
valuewithcodecand write it as one length-delimited frame.