Struct sttp::transport::CompactMeasurement
source · pub struct CompactMeasurement { /* private fields */ }
Expand description
Represents a compact Measurement
for transmission or reception in the STTP API.
Implementations§
source§impl CompactMeasurement
impl CompactMeasurement
sourcepub fn new(
signal_index_cache: Arc<SignalIndexCache>,
include_time: bool,
use_millisecond_resolution: bool
) -> Self
pub fn new(
signal_index_cache: Arc<SignalIndexCache>,
include_time: bool,
use_millisecond_resolution: bool
) -> Self
Creates a new CompactMeasurement
.
sourcepub fn include_time(&self) -> bool
pub fn include_time(&self) -> bool
Gets flag that determines if time is serialized into measurement binary image.
sourcepub fn get_binary_length(&mut self) -> usize
pub fn get_binary_length(&mut self) -> usize
Gets the length of the CompactMeasurement
.
sourcepub fn get_timestamp_c2(&self) -> u16
pub fn get_timestamp_c2(&self) -> u16
Gets offset compressed millisecond-resolution 2-byte timestamp.
sourcepub fn get_timestamp_c4(&self) -> u32
pub fn get_timestamp_c4(&self) -> u32
Gets offset compressed tick-resolution 4-byte timestamp.
sourcepub fn get_compact_state_flags(&self) -> u8
pub fn get_compact_state_flags(&self) -> u8
Gets byte level compact state flags with encoded time index and base time offset bits.
sourcepub fn set_compact_state_flags(&mut self, value: u8)
pub fn set_compact_state_flags(&mut self, value: u8)
Sets byte level compact state flags with encoded time index and base time offset bits.
sourcepub fn get_runtime_id(&self) -> i32
pub fn get_runtime_id(&self) -> i32
Gets the 4-byte run-time signal index for this measurement.
sourcepub fn set_runtime_id(&mut self, signal_index: i32)
pub fn set_runtime_id(&mut self, signal_index: i32)
Sets the 4-byte run-time signal index for this measurement.
Trait Implementations§
source§impl Clone for CompactMeasurement
impl Clone for CompactMeasurement
source§fn clone(&self) -> CompactMeasurement
fn clone(&self) -> CompactMeasurement
Returns a copy of the value. Read more
1.0.0 · 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 CompactMeasurement
impl Debug for CompactMeasurement
source§impl Display for CompactMeasurement
impl Display for CompactMeasurement
source§impl Measurement for CompactMeasurement
impl Measurement for CompactMeasurement
source§fn set_signal_id(&mut self, signal_id: Uuid)
fn set_signal_id(&mut self, signal_id: Uuid)
Sets measurement’s globally unique identifier.
source§fn timestamp(&self) -> Ticks
fn timestamp(&self) -> Ticks
Gets the STTP uint64 timestamp, in ticks, that measurement was taken.
source§fn set_timestamp(&mut self, timestamp: Ticks)
fn set_timestamp(&mut self, timestamp: Ticks)
Sets the STTP uint64 timestamp, in ticks, that measurement was taken.
source§fn flags(&self) -> StateFlags
fn flags(&self) -> StateFlags
Gets flags indicating the state of the measurement as reported by the device that took it.
source§fn 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.
source§fn 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.