fn parse_policy_rule(
config: PolicyRuleConfig,
) -> Result<PolicyRule, ConfigError>Expand description
Converts a deserialized PolicyRuleConfig into a validated PolicyRule.
Returns an error if the rule’s trigger or any contained action is invalid.
§Examples
ⓘ
let cfg = PolicyRuleConfig {
trigger: "task_end".to_string(),
actions: vec![ActionConfig::Summarize { target: "log".to_string() }],
};
let rule = parse_policy_rule(cfg).expect("valid policy rule");
assert_eq!(rule.trigger.to_string(), "task_end");
assert_eq!(rule.actions.len(), 1);