Struct proj_billing::billing::consumption::integer_consumption::IntegerConsumption
[−]
[src]
pub struct IntegerConsumption { pub hour_of_week: u64, pub units_consumed: i32, }
Consumption information for hourly time of use billing
Fields
hour_of_week: u64
The hour in the week: e.g. 7am on a Tuesday would be 24+7 hours.
units_consumed: i32
The number of units of the utility which were consumed in the last hour
Trait Implementations
impl Debug for IntegerConsumption
[src]
impl Consumption<i32, u64> for IntegerConsumption
[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: i32, other: u64) -> IntegerConsumption
Instance new consumption
fn null_prices() -> Prices
Make an empty prices object
fn set_price(prices: &mut Prices, other: u64, price: i32)
Set Price for a particular other
fn get_price(prices: &Prices, other: u64) -> i32
Get Price of a particular other
fn prices_len() -> usize
Length of a Prices
fn cons_from_bytes(bytes: &[u8]) -> i32
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