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

Function get_bool

crates/openshell-supervisor-network/src/opa.rs:658–667  ·  view source on GitHub ↗

Extract a bool from a `regorus::Value` object field.

(val: &regorus::Value, key: &str)

Source from the content-addressed store, hash-verified

656
657/// Extract a bool from a `regorus::Value` object field.
658fn get_bool(val: &regorus::Value, key: &str) -> Option<bool> {
659 let key_val = regorus::Value::String(key.into());
660 match val {
661 regorus::Value::Object(map) => match map.get(&key_val) {
662 Some(regorus::Value::Bool(b)) => Some(*b),
663 _ => None,
664 },
665 _ => None,
666 }
667}
668
669/// Extract a string array from a `regorus::Value` object field.
670fn get_str_array(val: &regorus::Value, key: &str) -> Vec<String> {

Callers 1

parse_filesystem_policyFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected