/// Handles an `UpdateThermalLoad` message.
///
/// The new thermal load is checked for validity then passed on to each `ClientState` entry for
/// further processing.
Handles an `UpdateThermalLoad` message.
The new thermal load is checked for validity then passed on to each `ClientState` entry for
further processing.
Handles an ` UpdateThermalLoad ` message . The new thermal load is checked for validity then passed on to each ` ClientState ` entry for further processing .
fn handle_update_thermal_load(
        &self,
        thermal_load: ThermalLoad,
        sensor: &str,
    ) -> Result<MessageReturn, PowerManagerError> {
        fuchsia_trace::duration!(
            "power_manager",
            "ThermalStateHandler::handle_update_thermal_load",
            "thermal_load" => thermal_load.0,
            "sensor" => sensor
        );
        if thermal_load > ThermalLoad(fthermal::MAX_THERMAL_LOAD) {
            return Err(PowerManagerError::InvalidArgument(format!(
                "Thermal load {:?} exceeds max {}",
                thermal_load,
                fthermal::MAX_THERMAL_LOAD
            )));
        }
        self.client_states.process_new_thermal_load(thermal_load, sensor);
        Ok(MessageReturn::UpdateThermalLoad)
    }
fn handle_update_thermal_load ( & self , thermal_load : ThermalLoad , sensor : & str , ) -> Result < MessageReturn , PowerManagerError > { fuchsia_trace :: duration ! ( " " " " " " thermal_load 0 " " sensor ) ; if thermal_load > ThermalLoad ( fthermal :: MAX_THERMAL_LOAD ) { return Err ( PowerManagerError :: InvalidArgument ( format ! ( " " thermal_load fthermal MAX_THERMAL_LOAD ) ) ) ; } self . client_states . process_new_thermal_load ( thermal_load , sensor ) ; Ok ( MessageReturn :: UpdateThermalLoad ) }
Handles an `UpdateThermalLoad` message.
Handles an ` UpdateThermalLoad ` message .
&self
thermal_load
ThermalLoad
sensor
&str