/// Updates the `ClientConfig` for `ClientType` then reevalutes their power level.
///
/// If there was not a previous `ClientState` entry for the provided `ClientType` then one is
/// first created and added to the `self.states` map. After the new configuration is updated,
/// the client's power level is reevaluated using the provided `system_power_modes`.
Updates the `ClientConfig` for `ClientType` then reevalutes their power level.
Updates the ` ClientConfig ` for ` ClientType ` then reevalutes their power level .
fn update_config(
        &self,
        client_type: ClientType,
        config: ClientConfig,
        system_power_modes: &HashSet<SystemMode>,
    ) {
        let mut states = self.states.borrow_mut();
        let client_state = if let Some(client_state) = states.get_mut(&client_type) {
            client_state.client_state_inspect.set_config(&config);
            client_state.config = config;
            client_state
        } else {
            states
                .insert(client_type, ClientState::new(client_type, config, &self.clients_inspect));
            states.get_mut(&client_type).unwrap()
        };
        client_state.process_system_power_modes_changed(system_power_modes);
    }
fn update_config ( & self , client_type : ClientType , config : ClientConfig , system_power_modes : & HashSet < SystemMode > , ) { let mut states = self . states . borrow_mut ( ) ; let client_state = if let Some ( client_state ) = states . get_mut ( & client_type ) { client_state . client_state_inspect . set_config ( & config ) ; client_state . config = config ; client_state } else { states . insert ( client_type , ClientState :: new ( client_type , config , & self . clients_inspect ) ) ; states . get_mut ( & client_type ) . unwrap ( ) } ; client_state . process_system_power_modes_changed ( system_power_modes ) ; }
Updates the `ClientConfig` for `ClientType` then reevalutes their power level.
Updates the ` ClientConfig ` for ` ClientType ` then reevalutes their power level .
&self
client_type
ClientType
config
ClientConfig
system_power_modes
&HashSet<SystemMode>