pub fn new<U: Into<String>>(consumption_bound: f64, broker_url: U) -> Result<Self, PvError> {
        if consumption_bound.is_finite() && consumption_bound.is_sign_positive() {
            Ok(Meter {
                consumption_bound,
                broker_url: broker_url.into(),
            })
        } else {
            Err(PvError::InternalError(format!(
                "{} is not a positive finite number.",
                consumption_bound
            )))
        }
    }
/// Creates a new `Meter` sampling random power consumption values in Watt.
/// If zero is specified as upper bound, only zero values will be sampled.
/// Fails, if the `consumption_bound` is not a positive finite number.
///
/// # Parameters
///
/// * `consumption_bound` - the exclusive upper bound of power consumption
/// * `broker_url` - the url of the broker
Creates a new `Meter` sampling random power consumption values in Watt.
If zero is specified as upper bound, only zero values will be sampled.
Fails, if the `consumption_bound` is not a positive finite number.
Creates a new ` Meter ` sampling random power consumption values in Watt . If zero is specified as upper bound only zero values will be sampled . Fails if the ` consumption_bound ` is not a positive finite number .
pub fn new<U: Into<String>>(consumption_bound: f64, broker_url: U) -> Result<Self, PvError> {
        if consumption_bound.is_finite() && consumption_bound.is_sign_positive() {
            Ok(Meter {
                consumption_bound,
                broker_url: broker_url.into(),
            })
        } else {
            Err(PvError::InternalError(format!(
                "{} is not a positive finite number.",
                consumption_bound
            )))
        }
    }
pub fn new < U : Into < String > > ( consumption_bound : f64 , broker_url : U ) -> Result < Self , PvError > { if consumption_bound . is_finite ( ) && consumption_bound . is_sign_positive ( ) { Ok ( Meter { consumption_bound , broker_url : broker_url . into ( ) , } ) } else { Err ( PvError :: InternalError ( format ! ( " " consumption_bound ) ) ) } }
Creates a new `Meter` sampling random power consumption values in Watt.
Creates a new ` Meter ` sampling random power consumption values in Watt .
consumption_bound
f64
broker_url
U
consumption_bound
f64
broker_url
U