Skip to main content

Module limits

Module limits 

Source
Expand description

Decode time record limits, shared by every PowerIO wire.

The stored .pio.json record wire and the core record wire must refuse the same hostile inputs: every sequence, map, and string is bounded while it is decoded, before the full collection has been retained. The helpers here run inside serde visitors (#[serde(deserialize_with = ...)]), so the only transient allocation is the JSON scanner’s own token buffer.

Structs§

BoundedStr
A string field that is refused past max_bytes, checked before the text is retained.
TruncatedStr
A string field that is truncated at a character boundary once max_bytes have been retained. Used for message text whose semantic limit is already a truncation rule rather than a refusal.

Constants§

MAX_DIAGNOSTIC_CODE_BYTES
MAX_DIAGNOSTIC_DETAIL_KEYS
MAX_DIAGNOSTIC_MESSAGE_BYTES
MAX_DIAGNOSTIC_MESSAGE_DECODE_BYTES
Raw bytes retained for one message while decoding, before sanitization. Every writer sanitizes at construction, so a stored message near this bound was not produced by PowerIO; past it the raw text is truncated, and the result is still sanitized to one bounded line.
MAX_DIAGNOSTIC_RELATED
MAX_DIAGNOSTIC_SPANS
MAX_DIAGNOSTIC_TARGET_BYTES
MAX_HISTORY_NOTES
MAX_HISTORY_PARAMETERS
MAX_IDENTIFIER_BYTES
MAX_MODULE_DIAGNOSTICS
MAX_MODULE_EXTENSION_KEYS
MAX_MODULE_HISTORY_ENTRIES
MAX_MODULE_SOURCES
Module level record counts. Each stored module list is refused at its count while it is decoded, so a small hostile document cannot declare its way into an unbounded record allocation.
MAX_MODULE_SOURCE_MAP_ENTRIES
MAX_SOURCE_MAP_SPANS

Functions§

bounded_json_map
bounded_vec