Skip to main content

Module frame

Module frame 

Source
Expand description

Length-delimited framing: 4-byte big-endian length prefix + UTF-8 JSON body (spec §5).

Structs§

FrameDecoder
Incremental decoder: feed arbitrary chunks via push, pull complete frame bodies via next_frame. Tolerant of frames split across chunk boundaries.

Enums§

FrameError

Constants§

MAX_FRAME_LEN
Hard cap on a single frame body (16 MiB). A length prefix larger than this is rejected before any allocation, so a garbage/hostile length can’t OOM the host.

Functions§

encode_frame
Encode a payload as a 4-byte big-endian length prefix followed by the body.