Struct proj_billing::billing::consumption::floating_consumption::FloatingConsumption
[−]
[src]
pub struct FloatingConsumption { pub hour_of_week: u8, pub units_consumed: f32, }
Consumption information for hourly time of use billing
Fields
hour_of_week: u8
The hour in the week: e.g. 7am on a Tuesday would be 24+7 hours.
units_consumed: f32
The number of units of the utility which were consumed in the last hour
Trait Implementations
impl Debug for FloatingConsumption
[src]
impl Consumption<f32, u8> for FloatingConsumption
[src]
type Prices = Prices
Co-efficients for the number of consumption units for each hour of day each week
fn is_valid(&self) -> bool
Checks that the values stored in a Consumption object are legal
fn new(cons: f32, other: u8) -> FloatingConsumption
Instance new consumption
fn null_prices() -> Prices
Make an empty prices object
fn set_price(prices: &mut Prices, other: u8, price: f32)
Set Price for a particular other
fn get_price(prices: &Prices, other: u8) -> f32
Get Price of a particular other
fn prices_len() -> usize
Length of a Prices
fn cons_from_bytes(bytes: &[u8]) -> f32
Cons from raw bytes
fn prices_from_bytes(bytes: &[u8]) -> Prices
Prices from raw bytes
fn prices_to_bytes(prices: &Prices) -> Vec<u8>
Prices to raw bytes