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

Function value_to_string

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

Convert a `regorus::Value` to a string, handling various types.

(val: &regorus::Value)

Source from the content-addressed store, hash-verified

635
636/// Convert a `regorus::Value` to a string, handling various types.
637fn value_to_string(val: &regorus::Value) -> String {
638 match val {
639 regorus::Value::String(s) => s.to_string(),
640 regorus::Value::Undefined => String::new(),
641 other => other.to_string(),
642 }
643}
644
645/// Extract a string from a `regorus::Value` object field.
646fn get_str(val: &regorus::Value, key: &str) -> Option<String> {

Callers 2

evaluate_networkMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected