pub struct PropertySample {
pub path: PropertyPath,
pub value: Value,
pub source_ts_ms: Option<i64>,
pub quality: u32,
}Expand description
One piece of telemetry — the value of a property, plus optional timestamp / quality metadata captured at the protocol layer.
Fields§
§path: PropertyPathThe path the value was read from.
value: ValueThe value itself.
source_ts_ms: Option<i64>Optional protocol-supplied source timestamp, in milliseconds since
the Unix epoch. None for protocols (Modbus, MQTT) that do not
carry one.
quality: u32Optional protocol-specific quality code (OPC UA StatusCode,
Modbus exception code, …). 0 = good.
Implementations§
Source§impl PropertySample
impl PropertySample
Sourcepub fn now(path: PropertyPath, value: Value) -> Self
pub fn now(path: PropertyPath, value: Value) -> Self
Construct a fresh sample with no timestamp and quality = 0.
Trait Implementations§
Source§impl Clone for PropertySample
impl Clone for PropertySample
Source§fn clone(&self) -> PropertySample
fn clone(&self) -> PropertySample
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PropertySample
impl Debug for PropertySample
Source§impl PartialEq for PropertySample
impl PartialEq for PropertySample
impl StructuralPartialEq for PropertySample
Auto Trait Implementations§
impl Freeze for PropertySample
impl RefUnwindSafe for PropertySample
impl Send for PropertySample
impl Sync for PropertySample
impl Unpin for PropertySample
impl UnsafeUnpin for PropertySample
impl UnwindSafe for PropertySample
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