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

Method from_str

crates/openshell-driver-podman/src/config.rs:56–66  ·  view source on GitHub ↗
(s: &str)

Source from the content-addressed store, hash-verified

54 type Err = String;
55
56 fn from_str(s: &str) -> Result<Self, Self::Err> {
57 match s.to_ascii_lowercase().as_str() {
58 "always" => Ok(Self::Always),
59 "missing" => Ok(Self::Missing),
60 "never" => Ok(Self::Never),
61 "newer" => Ok(Self::Newer),
62 other => Err(format!(
63 "invalid pull policy '{other}'; expected one of: always, missing, never, newer"
64 )),
65 }
66 }
67}
68
69#[derive(Clone, serde::Serialize, serde::Deserialize)]

Callers

nothing calls this directly

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected