Parse a sandbox policy from a YAML string.
(yaml: &str)
| 958 | |
| 959 | /// Parse a sandbox policy from a YAML string. |
| 960 | pub fn parse_sandbox_policy(yaml: &str) -> Result<SandboxPolicy> { |
| 961 | let raw: PolicyFile = serde_yml::from_str(yaml) |
| 962 | .into_diagnostic() |
| 963 | .wrap_err("failed to parse sandbox policy YAML")?; |
| 964 | Ok(to_proto(raw)) |
| 965 | } |
| 966 | |
| 967 | /// Serialize a proto sandbox policy to a YAML string. |
| 968 | /// |