Skip to main content

Module parser

Module parser 

Source

Enums§

DependencySource
Dependency source location (shared across all ecosystems).
LoadingState
Loading state for registry data fetching.

Constants§

MAX_JSON_NESTING_DEPTH
Maximum allowed nesting depth for JSON array/object recursion before check_json_nesting_depth rejects the input.
MAX_TOML_NESTING_DEPTH
Maximum allowed nesting depth for TOML table/array recursion before check_toml_nesting_depth rejects the input.
MAX_YAML_EXPANDED_BYTES
Maximum total byte weight check_yaml_expansion allows a document to expand to (counting anchor/alias-driven duplication) before rejecting it.
MAX_YAML_NESTING_DEPTH
Maximum allowed nesting depth for YAML block/flow recursion before check_yaml_nesting_depth rejects the input.

Functions§

check_json_nesting_depth
Scans raw JSON bytes for [/{ nesting deeper than max_depth, before handing the bytes to serde_json::from_slice/from_str.
check_toml_nesting_depth
Scans raw TOML text for table/array recursion deeper than max_depth.
check_yaml_expansion
Streams content through yaml-rust2’s own parser event stream and tallies the total bytes the Yaml nodes YamlLoader::load_from_str would allocate, rejecting once the tally exceeds max_bytes.
check_yaml_nesting_depth
Scans raw YAML text for block/flow recursion deeper than max_depth.
parse_json_checked
Deserializes bytes into T, first rejecting payloads whose JSON nesting exceeds MAX_JSON_NESTING_DEPTH (see that constant’s doc for why).