pub struct History<'a> { /* private fields */ }Expand description
A rolling in-memory history covering the current billing day and its 41 predecessors.
Implementations§
Source§impl<'a> History<'a>
impl<'a> History<'a>
Sourcepub fn new(
quantity: Quantity<'a>,
boundaries: &'a [i64],
) -> Result<History<'a>, Error>
pub fn new( quantity: Quantity<'a>, boundaries: &'a [i64], ) -> Result<History<'a>, Error>
Supply every consecutive local day opening in UTC, followed by the exclusive end. This electricity profile accepts 23-, 24- and 25-hour billing days.
Sourcepub fn record(
&mut self,
quantity: Quantity<'_>,
opening_utc: i64,
wh: u64,
) -> Result<(), Error>
pub fn record( &mut self, quantity: Quantity<'_>, opening_utc: i64, wh: u64, ) -> Result<(), Error>
Finalize a qualified daily balance once. Omit days with unavailable readings.
Auto Trait Implementations§
impl<'a> Freeze for History<'a>
impl<'a> RefUnwindSafe for History<'a>
impl<'a> Send for History<'a>
impl<'a> Sync for History<'a>
impl<'a> Unpin for History<'a>
impl<'a> UnsafeUnpin for History<'a>
impl<'a> UnwindSafe for History<'a>
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