pub struct Metric {
pub name: Option<String>,
pub alias: Option<u64>,
pub timestamp: Option<u64>,
pub datatype: Option<u32>,
pub is_historical: Option<bool>,
pub is_transient: Option<bool>,
pub is_null: Option<bool>,
pub metadata: Option<MetaData>,
pub properties: Option<PropertySet>,
pub value: Option<Value>,
}Fields§
§name: Option<String>Metric name - should only be included on birth
alias: Option<u64>Metric alias - tied to name on birth and included in all later DATA messages
timestamp: Option<u64>Timestamp associated with data acquisition time
datatype: Option<u32>DataType of the metric/tag value
is_historical: Option<bool>If this is historical data and should not update real time tag
is_transient: Option<bool>Tells consuming clients such as MQTT Engine to not store this as a tag
is_null: Option<bool>If this is null - explicitly say so rather than using -1, false, etc for some datatypes.
metadata: Option<MetaData>Metadata for the payload
properties: Option<PropertySet>§value: Option<Value>Implementations§
Source§impl Metric
impl Metric
Sourcepub fn timestamp(&self) -> u64
pub fn timestamp(&self) -> u64
Returns the value of timestamp, or the default value if timestamp is unset.
Sourcepub fn datatype(&self) -> u32
pub fn datatype(&self) -> u32
Returns the value of datatype, or the default value if datatype is unset.
Sourcepub fn is_historical(&self) -> bool
pub fn is_historical(&self) -> bool
Returns the value of is_historical, or the default value if is_historical is unset.
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Returns the value of is_transient, or the default value if is_transient is unset.
Source§impl Metric
impl Metric
pub fn new() -> Self
pub fn set_name(&mut self, name: String) -> &mut Self
pub fn set_alias(&mut self, alias: u64) -> &mut Self
pub fn set_datatype(&mut self, datatype: DataType) -> &mut Self
pub fn set_timestamp(&mut self, timestamp: u64) -> &mut Self
pub fn set_value(&mut self, value: Value) -> &mut Self
pub fn set_null(&mut self) -> &mut Self
Trait Implementations§
Source§impl Message for Metric
impl Message for Metric
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.