pub struct MeterReading {
pub at: OffsetDateTime,
pub register: Energy,
pub direction: Direction,
pub context: ReadingContext,
pub signed: bool,
}Expand description
One reading of a cumulative energy register.
Cumulative, not incremental: this is the register’s own running total, the quantity OCMF signs and the quantity a difference between two readings is taken of. An incremental value cannot be checked against anything.
Fields§
§at: OffsetDateTimeWhen the register held this value.
register: EnergyThe register’s value.
direction: DirectionWhich way the energy this register counts was flowing.
context: ReadingContextWhy this reading was taken.
signed: boolWhether a signed record backs this reading.
Set by the layer that has the evidence. A reading nobody signed may
still be perfectly good telemetry; it may not be the basis of an
invoice [MessEG §33].
Implementations§
Source§impl MeterReading
impl MeterReading
Sourcepub const fn new(
at: OffsetDateTime,
register: Energy,
direction: Direction,
context: ReadingContext,
) -> Self
pub const fn new( at: OffsetDateTime, register: Energy, direction: Direction, context: ReadingContext, ) -> Self
A reading, unsigned.
Trait Implementations§
Source§impl Clone for MeterReading
impl Clone for MeterReading
Source§impl Debug for MeterReading
impl Debug for MeterReading
Source§impl<'de> Deserialize<'de> for MeterReading
impl<'de> Deserialize<'de> for MeterReading
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MeterReading
Source§impl PartialEq for MeterReading
impl PartialEq for MeterReading
Source§impl Serialize for MeterReading
impl Serialize for MeterReading
impl StructuralPartialEq for MeterReading
Auto Trait Implementations§
impl Forget for MeterReading
impl Freeze for MeterReading
impl Move for MeterReading
impl RefUnwindSafe for MeterReading
impl Send for MeterReading
impl Sync for MeterReading
impl Unpin for MeterReading
impl UnsafeUnpin for MeterReadingwhere
NonZeroI32Inner: UnsafeUnpin,
impl UnwindSafe for MeterReading
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