pub struct Registers { /* private fields */ }Expand description
Fixed-size derived registers for one continuous, nondecreasing register trace.
Implementations§
Source§impl Registers
impl Registers
Sourcepub fn new(start_utc: i64, baseline_wh: u64) -> Result<Registers, Error>
pub fn new(start_utc: i64, baseline_wh: u64) -> Result<Registers, Error>
Start at a validated cumulative reading. All derived registers start at zero.
pub fn total_wh(&self) -> u64
pub fn error_wh(&self) -> u64
pub fn tariff_wh(&self, tariff: TariffRegister) -> u64
Sourcepub fn record(
&mut self,
end_utc: i64,
tariff: TariffRegister,
reading: Reading,
) -> Result<Outcome, Error>
pub fn record( &mut self, end_utc: i64, tariff: TariffRegister, reading: Reading, ) -> Result<Outcome, Error>
Submit one elapsed period, even if its reading is missing. At a switch on
the closing boundary, supply the outgoing register. After Fatal, start
a new instance for the replacement meter.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Registers
impl RefUnwindSafe for Registers
impl Send for Registers
impl Sync for Registers
impl Unpin for Registers
impl UnsafeUnpin for Registers
impl UnwindSafe for Registers
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more