MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / serialize_sandbox_policy_json

Function serialize_sandbox_policy_json

crates/openshell-policy/src/lib.rs:991–996  ·  view source on GitHub ↗

Serialize a proto sandbox policy to a pretty-printed JSON string.

(policy: &SandboxPolicy)

Source from the content-addressed store, hash-verified

989
990/// Serialize a proto sandbox policy to a pretty-printed JSON string.
991pub fn serialize_sandbox_policy_json(policy: &SandboxPolicy) -> Result<String> {
992 let json_repr = sandbox_policy_to_json_value(policy)?;
993 serde_json::to_string_pretty(&json_repr)
994 .into_diagnostic()
995 .wrap_err("failed to serialize policy to JSON")
996}
997
998/// Load a sandbox policy from an explicit source.
999///

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected