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

Function materialize_global_settings

crates/openshell-server/src/grpc/policy.rs:3879–3898  ·  view source on GitHub ↗
(
    global: &StoredSettings,
)

Source from the content-addressed store, hash-verified

3877}
3878
3879fn materialize_global_settings(
3880 global: &StoredSettings,
3881) -> Result<HashMap<String, SettingValue>, Status> {
3882 let mut materialized = HashMap::new();
3883 for registered in settings::REGISTERED_SETTINGS {
3884 materialized.insert(registered.key.to_string(), SettingValue { value: None });
3885 }
3886
3887 for (key, value) in &global.settings {
3888 if key == POLICY_SETTING_KEY {
3889 continue;
3890 }
3891 if settings::setting_for_key(key).is_none() {
3892 continue;
3893 }
3894 materialized.insert(key.clone(), stored_setting_to_proto(value)?);
3895 }
3896
3897 Ok(materialized)
3898}
3899
3900// ---------------------------------------------------------------------------
3901// Tests

Calls 2

setting_for_keyFunction · 0.85
stored_setting_to_protoFunction · 0.85