/// Creates a vector of `TripPointState`s from the given `ClientConfig`.
///
/// The vector is essentially just a flattened out view of the `ClientConfig`, which allows for
/// convenient iteration later when determining which trip points and states are active.
Creates a vector of `TripPointState`s from the given `ClientConfig`.
The vector is essentially just a flattened out view of the `ClientConfig`, which allows for
convenient iteration later when determining which trip points and states are active.
Creates a vector of ` TripPointState ` s from the given ` ClientConfig ` . The vector is essentially just a flattened out view of the ` ClientConfig ` which allows for convenient iteration later when determining which trip points and states are active .
fn create_trip_point_states_from_client_config(client_config: ClientConfig) -> Vec<TripPointState> {
    client_config
        .into_thermal_states()
        .into_iter()
        .map(|state_config| {
            let state = ThermalState(state_config.state);
            state_config.trip_points.into_iter().map(move |trip_point| TripPointState {
                sensor: trip_point.sensor,
                activate_at: ThermalLoad(trip_point.activate_at),
                deactivate_below: ThermalLoad(trip_point.deactivate_below),
                is_active: false,
                state,
            })
        })
        .flatten()
        .collect()
}
fn create_trip_point_states_from_client_config ( client_config : ClientConfig ) -> Vec < TripPointState > { client_config . into_thermal_states ( ) . into_iter ( ) . map ( | state_config | { let state = ThermalState ( state_config . state ) ; state_config . trip_points . into_iter ( ) . map ( move | trip_point | TripPointState { sensor : trip_point . sensor , activate_at : ThermalLoad ( trip_point . activate_at ) , deactivate_below : ThermalLoad ( trip_point . deactivate_below ) , is_active : false , state , } ) } ) . flatten ( ) . collect ( ) }
Creates a vector of `TripPointState`s from the given `ClientConfig`.
Creates a vector of ` TripPointState ` s from the given ` ClientConfig ` .
client_config
ClientConfig