Skip to main content

MeterReading

Struct MeterReading 

Source
pub struct MeterReading { /* private fields */ }
Expand description

One scope-checked DataValue. Serialize this to retain its independent clocks, raw UInt32 status, and the original integer or floating-point bit pattern on Good severity.

Implementations§

Source§

impl MeterReading

Source

pub fn compact_line_bytes(&self) -> usize

Cached byte size of this compact UTF-8 JSON reading plus one LF. This is the exact input charge for MeterProjector::push.

Source

pub fn status(&self) -> u32

Full OPC UA Value read status, including subcode and information bits.

Source

pub fn value(&self) -> Option<u64>

Original UInt32 or UInt64 register value when the wire status has Good severity.

Source

pub fn value_bits(&self) -> Option<u32>

Original binary32 bits for a Float register when the wire status has Good severity.

Source

pub fn double_bits(&self) -> Option<u64>

Original binary64 bits for a Double register when the wire status has Good severity.

Source

pub fn source_at(&self) -> Option<OffsetDateTime>

Original source clock, normalized to UTC at its supplied precision.

Source

pub fn server_at(&self) -> Option<OffsetDateTime>

Original server clock when the read included it.

Source

pub fn received_at(&self) -> OffsetDateTime

UTC receipt time measured by the reader.

Trait Implementations§

Source§

impl Debug for MeterReading

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for MeterReading

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.