pub fn validate_frontmatter(
fm: &Frontmatter,
max_depth: usize,
max: usize,
) -> Result<(), Error>Expand description
Validates a front matter structure against configured limits.
Checks:
- Maximum nesting depth.
- Maximum number of keys.
- Structure validity.
§Arguments
fm- Reference to the front matter to validate.max_depth- Maximum allowed nesting depth.max- Maximum allowed number of keys.
§Returns
Ok(()) if validation passes, Error otherwise.
§Errors
Returns Error if:
- The number of keys exceeds
max. - The nesting depth exceeds
max_depth.