Expand description
Parser configuration for resource limits and behavior tuning.
This module provides ParseConfig for controlling parser behavior,
including recursion limits to prevent stack overflow attacks.
§Recursion Limits
Following the pattern established by serde_json, parsers should enforce
a maximum recursion depth to prevent malicious or malformed input from
causing stack overflows. The default limit of 128 balances security with
practical use cases.
§Example
ⓘ
use synkit_core::config::ParseConfig;
// Use default limits (recursion depth: 128)
let config = ParseConfig::default();
// Increase limit for deeply nested data
let config = ParseConfig::new()
.with_max_recursion_depth(256);
// Disable recursion limit (use with caution!)
let config = ParseConfig::new()
.with_max_recursion_depth(usize::MAX);Structs§
- Parse
Config - Configuration for parser behavior and resource limits.
- Recursion
Guard - Tracks recursion depth during parsing.