pub fn parse(yaml: &str) -> Result<ScenarioFile, ParseError>Expand description
Parse a YAML string as a v2 scenario file.
Performs deserialization followed by structural validation:
- Version must be exactly
2. - Single-signal shorthand (no
scenarios:key) is promoted to a one-entry file. - Entry
idvalues must be unique and match[a-zA-Z_][a-zA-Z0-9_]*. signal_typemust be one ofmetrics,logs,histogram,summary.- Each entry has either
generator/distributionorpack, not both. - Cross-generator mutual exclusion: each signal type may only carry its
expected generator field (
generatorfor metrics,log_generatorfor logs,distributionfor histogram/summary). The other fields must be absent. - Pack entries must have
signal_type: metrics. - Inline (non-pack) entries must have
name.
Note: after.ref references are not resolved during parsing. Reference
resolution, threshold validation, and timing computation happen during
compilation (see the after compiler).
Note: after.op is deserialized as an AfterOp enum.
Invalid operator values (anything other than "<" or ">") are rejected
by serde during deserialization.
§Errors
Returns ParseError describing the first validation failure found.