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

Function extension_label_enabled

crates/openshell-driver-vm/src/lifecycle.rs:675–687  ·  view source on GitHub ↗

Interpret an extension request-label value. Accepts the explicit `enabled`/`requested` spellings as well as the common bool-like values understood by [`parse_bool_like`]; anything unrecognized is treated as "not requested" so a malformed label fails closed.

(value: &str)

Source from the content-addressed store, hash-verified

673/// understood by [`parse_bool_like`]; anything unrecognized is treated as
674/// "not requested" so a malformed label fails closed.
675fn extension_label_enabled(value: &str) -> bool {
676 let normalized = value.trim().to_ascii_lowercase();
677 if matches!(
678 normalized.as_str(),
679 "enabled" | "enable" | "requested" | "request"
680 ) {
681 return true;
682 }
683 if matches!(normalized.as_str(), "disabled" | "disable") {
684 return false;
685 }
686 parse_bool_like(&normalized).unwrap_or(false)
687}
688
689fn warn_on_singleton_overwrite<T>(
690 extension_name: &str,

Callers 1

Calls 1

parse_bool_likeFunction · 0.85

Tested by

no test coverage detected