pub fn check_yaml_budget(
input: &str,
budget: Budget,
scope: EnforcingPolicy,
) -> Result<BudgetReport, ScanError>Expand description
Check an input &str against the given Budget.
Parameters:
input: YAML text (UTF-8). If you accept non-UTF-8, transcode before calling.budget: limits to enforce (seeBudget).
Returns:
Ok(report)—report.breached.is_none()means within budget. Ifreport.breached.is_some(), you should reject the input.Err(ScanError)— scanning (lexing/parsing) failed.
Note:
- This is streaming and does not allocate a DOM.
- Depth counts nested
SequenceStartandMappingStart. - Standalone budget checks do not receive
Options; merge keys are counted as if merge expansion is enabled, preserving historical behavior.