Skip to main content

load_str

Function load_str 

Source
pub fn load_str(input: &str) -> Result<RawPolicy>
Expand description

Load and validate an agent-policy.yaml from a string.

Parses YAML, validates against the bundled JSON Schema, and returns the raw policy struct on success. The caller is responsible for normalization.

§Errors

Returns crate::Error::Yaml on YAML parse failure or crate::Error::Schema if the document does not conform to the bundled JSON Schema.

§Panics

Panics if RawPolicy cannot be serialized to a JSON value, which is an internal invariant that holds as long as all field types implement Serialize.