Serialize a proto sandbox policy to a YAML string. This is the inverse of [`parse_sandbox_policy`] — the output uses the canonical YAML field names (e.g. `filesystem_policy`, not `filesystem`) and is round-trippable through `parse_sandbox_policy`.
(policy: &SandboxPolicy)
| 970 | /// canonical YAML field names (e.g. `filesystem_policy`, not `filesystem`) |
| 971 | /// and is round-trippable through `parse_sandbox_policy`. |
| 972 | pub fn serialize_sandbox_policy(policy: &SandboxPolicy) -> Result<String> { |
| 973 | let yaml_repr = from_proto(policy); |
| 974 | serde_yml::to_string(&yaml_repr) |
| 975 | .into_diagnostic() |
| 976 | .wrap_err("failed to serialize policy to YAML") |
| 977 | } |
| 978 | |
| 979 | /// Convert a proto sandbox policy into the canonical policy JSON representation. |
| 980 | /// |