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

Method from_pairs

crates/openshell-ocsf/src/objects/finding.rs:52–63  ·  view source on GitHub ↗
(pairs: &[(&str, &str)])

Source from the content-addressed store, hash-verified

50 /// Create evidence from a map of key-value pairs.
51 #[must_use]
52 pub fn from_pairs(pairs: &[(&str, &str)]) -> Self {
53 let mut map = serde_json::Map::new();
54 for (key, value) in pairs {
55 map.insert(
56 (*key).to_string(),
57 serde_json::Value::String((*value).to_string()),
58 );
59 }
60 Self {
61 data: Some(serde_json::Value::Object(map)),
62 }
63 }
64}
65
66/// OCSF Remediation object.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected