Skip to main content

Module bounded

Module bounded 

Source
Expand description

Bounded JSON: resource limits checked on raw bytes before typed parsing.

scan validates that a byte slice is exactly one RFC 8259 JSON value and that it stays within every ParseLimits bound, without recursion and without building any value. parse_bounded runs typed deserialization only after the scan accepts.

Reading bytes from a socket, file or other transport is the caller’s responsibility: this module judges a slice already in memory, so the transport must bound its own buffering (for example at max_bytes).

Structs§

ParseLimits
Resource bounds for one JSON document. There is no default: every caller states its limits.
ScanStats
What an accepted scan observed.

Enums§

BoundError
Why a scan refused its input. Offsets are byte offsets into the input.
ParseError
Why parse_bounded produced no value.

Functions§

parse_bounded
Scan bytes, then deserialize them into T.
scan
Validate bytes as exactly one JSON value within limits.