A genuinely incremental, platform-independent RESP2 decoder.
The decoder retains parsed state rather than a copy of the incomplete wire
frame. Each input byte is examined once. Progress.values may contain zero,
one, or several complete top-level replies, so transport reads and RESP
values never need to share boundaries.
Conservative per-reply defaults, shared with Config.default. These are
protocol limits, not a heap or aggregate exchange budget. Direct callers
must also bound input chunks and the total replies/bytes they retain.
Decode every complete top-level RESP2 value in chunk. Per-reply limits
reset between values; this does not limit aggregate chunk/output size.
Execute supplies read-size and cumulative exchange limits for clients.
Resource limits applied independently to each top-level RESP value.
Limits are invariant to how the transport fragments that value.
max_frame_length includes every wire byte in the value, while
max_line_length counts only bytes between a type prefix and CRLF.
max_values counts an aggregate itself plus all of its descendants.
max_depth counts array prefixes (including empty and null arrays), so a
top-level array has depth one. Array and bulk limits count immediate
elements and payload bytes, respectively.
The result of feeding a chunk. A failure also returns any complete
top-level values which preceded the malformed frame in the same input.
A failed decoder is terminal and must not be reused.