Structs§
- Capped
Iter - Iterator adapter that yields at most
MAX_ITERATION_COUNTitems and emits acrate::parser_warn!diagnostic, namingcontext, if the underlying iterator actually had more items than the cap. - Recursion
Guard - A reusable guard that tracks recursion depth and detects cycles.
Constants§
- MAX_
FIELD_ LENGTH - Default maximum length for individual string field values (10 MB).
- MAX_
ITERATION_ COUNT - Default maximum iteration count for loops processing items (100,000).
- MAX_
MANIFEST_ SIZE - Default maximum file size for non-archive manifest files (100 MB).
- MAX_
RECURSION_ DEPTH - Default maximum recursion depth for recursive parsing functions (50 levels).
Traits§
- Capped
Iter Ext - Extension trait providing
cappedon any iterator.
Functions§
- capped_
iteration_ limit - Returns the number of items to iterate for a collection of
total_len, capped atMAX_ITERATION_COUNT, and emits acrate::parser_warn!diagnostic when the cap actually truncates the input. - npm_
purl - Creates a correctly-formatted npm Package URL for scoped or regular packages.
- parse_
sri - Parses Subresource Integrity (SRI) format and returns hash as hex string.
- read_
file_ to_ string - Reads a file’s entire contents into a String with ADR 0004 security checks.
- split_
name_ email - Parses “Name email@domain.com” format into separate components.
- truncate_
field - Truncates a string field value to
MAX_FIELD_LENGTHbytes if it exceeds the limit, returning the truncated string. Returns the original string if within limits.