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

Function save_active_gateway

crates/openshell-bootstrap/src/metadata.rs:232–240  ·  view source on GitHub ↗

Save the active gateway name to persistent storage.

(name: &str)

Source from the content-addressed store, hash-verified

230
231/// Save the active gateway name to persistent storage.
232pub fn save_active_gateway(name: &str) -> Result<()> {
233 validated_gateway_name(name)?;
234 let path = user_active_gateway_path()?;
235 ensure_parent_dir_restricted(&path)?;
236 std::fs::write(&path, name)
237 .into_diagnostic()
238 .wrap_err_with(|| format!("failed to write active gateway to {}", path.display()))?;
239 Ok(())
240}
241
242fn read_gateway_name(path: &Path) -> Option<String> {
243 let value = read_nonempty_trimmed(path)?;

Calls 3

validated_gateway_nameFunction · 0.85
user_active_gateway_pathFunction · 0.85