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

Function upsert_setting_value

crates/openshell-server/src/grpc/policy.rs:3702–3714  ·  view source on GitHub ↗
(
    map: &mut BTreeMap<String, StoredSettingValue>,
    key: &str,
    value: StoredSettingValue,
)

Source from the content-addressed store, hash-verified

3700}
3701
3702fn upsert_setting_value(
3703 map: &mut BTreeMap<String, StoredSettingValue>,
3704 key: &str,
3705 value: StoredSettingValue,
3706) -> bool {
3707 match map.get(key) {
3708 Some(existing) if existing == &value => false,
3709 _ => {
3710 map.insert(key.to_string(), value);
3711 true
3712 }
3713 }
3714}
3715
3716pub(super) async fn load_global_settings(store: &Store) -> Result<StoredSettings, Status> {
3717 load_settings_record(store, GLOBAL_SETTINGS_OBJECT_TYPE, GLOBAL_SETTINGS_NAME).await

Calls 1

getMethod · 0.45