Struct proj_billing::billing::three_party::CustomerState
[−]
[src]
pub struct CustomerState<P: Read + Write, M: Read + Write> { pub prices: Prices, // some fields omitted }
State associated with the customer
Fields
prices: Prices
The prices currently used to calculate the bill
Methods
impl<P: Read + Write, M: Read + Write> CustomerState<P, M>
[src]
fn new(meter_channel: M,
provider_channel: P,
prices: Prices,
provider_key: PublicKey,
meter_key: PublicKey,
params: DHParams)
-> CustomerState<P, M>
provider_channel: P,
prices: Prices,
provider_key: PublicKey,
meter_key: PublicKey,
params: DHParams)
-> CustomerState<P, M>
Create a new CustomerState
fn readable_consumption_table(&self) -> String
For debugging and logging: outputs a human readable representation of the cons and other fields of the consumption table
fn send_billing_information(&mut self) -> i64
Calculate the bill and send it to the provider and return the bill
fn read_meter_messages(&mut self)
check for new consumption messages from the meter
fn read_provider_messages(&mut self)
check for price changes from the provider