Trait sttp::transport::Measurement
source · pub trait Measurement: Display {
fn signal_id(&self) -> Uuid;
fn set_signal_id(&mut self, signal_id: Uuid);
fn value(&self) -> f64;
fn set_value(&mut self, value: f64);
fn timestamp(&self) -> Ticks;
fn set_timestamp(&mut self, timestamp: Ticks);
fn flags(&self) -> StateFlags;
fn set_flags(&mut self, flags: StateFlags);
fn timestamp_value(&self) -> u64;
fn datetime(&self) -> DateTime<Utc>;
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult { ... }
}
Expand description
Defines a trait representing measured data in the STTP API.
Required Methods§
sourcefn set_signal_id(&mut self, signal_id: Uuid)
fn set_signal_id(&mut self, signal_id: Uuid)
Sets measurement’s globally unique identifier.
sourcefn timestamp(&self) -> Ticks
fn timestamp(&self) -> Ticks
Gets the STTP uint64 timestamp, in ticks, that measurement was taken.
sourcefn set_timestamp(&mut self, timestamp: Ticks)
fn set_timestamp(&mut self, timestamp: Ticks)
Sets the STTP uint64 timestamp, in ticks, that measurement was taken.
sourcefn flags(&self) -> StateFlags
fn flags(&self) -> StateFlags
Gets flags indicating the state of the measurement as reported by the device that took it.
sourcefn set_flags(&mut self, flags: StateFlags)
fn set_flags(&mut self, flags: StateFlags)
Sets flags indicating the state of the measurement as reported by the device that took it.
sourcefn timestamp_value(&self) -> u64
fn timestamp_value(&self) -> u64
Gets the integer-based time from a Measurement
ticks-based timestamp, i.e.,
the 62-bit time value excluding any leap-second flags.