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

Method from_str

crates/openshell-core/src/config.rs:103–113  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

101 type Err = String;
102
103 fn from_str(value: &str) -> Result<Self, Self::Err> {
104 match value.trim().to_ascii_lowercase().as_str() {
105 "kubernetes" => Ok(Self::Kubernetes),
106 "vm" => Ok(Self::Vm),
107 "docker" => Ok(Self::Docker),
108 "podman" => Ok(Self::Podman),
109 other => Err(format!(
110 "unsupported compute driver '{other}'. expected one of: kubernetes, vm, docker, podman"
111 )),
112 }
113 }
114}
115
116/// Auto-detect the appropriate compute driver based on the runtime environment.

Callers

nothing calls this directly

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected