Expand description
Wire framing: a 4-byte big-endian length prefix and a UTF-8 JSON body.
The declared length is checked against the ceiling before any body is decoded, and the first violation poisons the decoder for good: resynchronising on an attacker-chosen offset is worse than dropping the connection.
Structs§
- Frame
- One decoded wire frame: the raw body plus its parsed value.
- Frame
Decoder - Streaming decoder for length-prefixed JSON frames.
Constants§
- FRAME_
HEADER_ BYTES - Size of the length prefix that precedes every frame body.
Functions§
- decode_
body - Decode and check one frame body.
- encode_
frame - Serialise a value into one length-prefixed frame.
- project_
dto - Check an untrusted parsed value against the DTO rules.