pub struct ReadingSpec<'a> {
pub time: OcmfTime,
pub transaction: Option<TransactionMarker>,
pub value: Option<Decimal>,
pub obis: Option<&'a str>,
pub unit: Option<Unit<'a>>,
pub current_type: Option<CurrentType<'a>>,
pub cumulated_loss: Option<Decimal>,
pub error_flags: Option<&'a str>,
pub state: MeterState,
}Available on crate feature
sign only.Expand description
One reading, for the builder.
Fields§
§time: OcmfTimeTM.
transaction: Option<TransactionMarker>TX.
value: Option<Decimal>RV.
obis: Option<&'a str>RI.
unit: Option<Unit<'a>>RU.
current_type: Option<CurrentType<'a>>RT.
cumulated_loss: Option<Decimal>CL.
error_flags: Option<&'a str>EF.
state: MeterStateST.
Implementations§
Source§impl<'a> ReadingSpec<'a>
impl<'a> ReadingSpec<'a>
Sourcepub fn new(
time: OcmfTime,
value: Decimal,
obis: &'a str,
unit: Unit<'a>,
) -> Self
pub fn new( time: OcmfTime, value: Decimal, obis: &'a str, unit: Unit<'a>, ) -> Self
A reading of value in unit from register obis, with the meter in
good order.
Sourcepub const fn transaction(self, marker: TransactionMarker) -> Self
pub const fn transaction(self, marker: TransactionMarker) -> Self
Sets TX explicitly.
Sourcepub const fn current_type(self, t: CurrentType<'a>) -> Self
pub const fn current_type(self, t: CurrentType<'a>) -> Self
Sets RT.
Sourcepub const fn state(self, state: MeterState) -> Self
pub const fn state(self, state: MeterState) -> Self
Sets ST.
Sourcepub const fn error_flags(self, flags: &'a str) -> Self
pub const fn error_flags(self, flags: &'a str) -> Self
Sets EF.
Sourcepub const fn cumulated_loss(self, loss: Decimal) -> Self
pub const fn cumulated_loss(self, loss: Decimal) -> Self
Sets CL.
Trait Implementations§
Source§impl<'a> Clone for ReadingSpec<'a>
impl<'a> Clone for ReadingSpec<'a>
Auto Trait Implementations§
impl<'a> Freeze for ReadingSpec<'a>
impl<'a> RefUnwindSafe for ReadingSpec<'a>
impl<'a> Send for ReadingSpec<'a>
impl<'a> Sync for ReadingSpec<'a>
impl<'a> Unpin for ReadingSpec<'a>
impl<'a> UnsafeUnpin for ReadingSpec<'a>
impl<'a> UnwindSafe for ReadingSpec<'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