pub fn new(power_consumption: f64, time_stamp: DateTime<Utc>) -> Result<Self, PvError> {
        if power_consumption.is_finite() && power_consumption.is_sign_positive() {
            Ok(BrokerMessage {
                power_consumption: Some(power_consumption),
                time_stamp: Some(time_stamp),
            })
        } else {
            Err(PvError::InternalError(format!(
                "{} is not a positive finite number.",
                power_consumption
            )))
        }
    }
/// Creates a new `BrokerMessage`.
/// Fails, if the `power_consumption` is not a positive finite number.
/// A `None` as power consumption indicates an end of the simulation.
///
/// # Parameters
///
/// * `power_consumption` - the power consumption to be sent to the broker
/// * `time_stamp` - the sampling time point
Creates a new `BrokerMessage`.
Fails, if the `power_consumption` is not a positive finite number.
A `None` as power consumption indicates an end of the simulation.
Creates a new ` BrokerMessage ` . Fails if the ` power_consumption ` is not a positive finite number . A ` None ` as power consumption indicates an end of the simulation .
pub fn new(power_consumption: f64, time_stamp: DateTime<Utc>) -> Result<Self, PvError> {
        if power_consumption.is_finite() && power_consumption.is_sign_positive() {
            Ok(BrokerMessage {
                power_consumption: Some(power_consumption),
                time_stamp: Some(time_stamp),
            })
        } else {
            Err(PvError::InternalError(format!(
                "{} is not a positive finite number.",
                power_consumption
            )))
        }
    }
pub fn new ( power_consumption : f64 , time_stamp : DateTime < Utc > ) -> Result < Self , PvError > { if power_consumption . is_finite ( ) && power_consumption . is_sign_positive ( ) { Ok ( BrokerMessage { power_consumption : Some ( power_consumption ) , time_stamp : Some ( time_stamp ) , } ) } else { Err ( PvError :: InternalError ( format ! ( " " power_consumption ) ) ) } }
Creates a new `BrokerMessage`.
Creates a new ` BrokerMessage ` .
power_consumption
f64
time_stamp
DateTime<Utc>
power_consumption
f64
time_stamp
DateTime<Utc>