Struct GCDatapointValue
#[repr(transparent)]pub struct GCDatapointValue(sGCDatapointValue);Expand description
Represents a datapoint value that can be published to the core
TODO: Investigate adding generic constructor and getter methods
Tuple Fields§
§0: sGCDatapointValueImplementations§
§impl GCDatapointValue
impl GCDatapointValue
pub fn new_boolean(
datapoint_id: GCDatapointID,
timestamp_ns: u64,
value: bool,
quality: GCDatapointValueQuality,
) -> Self
pub fn new_boolean( datapoint_id: GCDatapointID, timestamp_ns: u64, value: bool, quality: GCDatapointValueQuality, ) -> Self
Creates a new datapoint value with a boolean value
pub fn new_timestamp_ns(
datapoint_id: GCDatapointID,
timestamp_ns: u64,
value: u64,
quality: GCDatapointValueQuality,
) -> Self
pub fn new_timestamp_ns( datapoint_id: GCDatapointID, timestamp_ns: u64, value: u64, quality: GCDatapointValueQuality, ) -> Self
Creates a new datapoint value with a timestamp as value
pub fn new_u64(
datapoint_id: GCDatapointID,
timestamp_ns: u64,
value: u64,
quality: GCDatapointValueQuality,
) -> Self
pub fn new_u64( datapoint_id: GCDatapointID, timestamp_ns: u64, value: u64, quality: GCDatapointValueQuality, ) -> Self
Creates a new datapoint value with a double point value
pub fn new_u32(
datapoint_id: GCDatapointID,
timestamp_ns: u64,
value: u32,
quality: GCDatapointValueQuality,
) -> Self
pub fn new_u32( datapoint_id: GCDatapointID, timestamp_ns: u64, value: u32, quality: GCDatapointValueQuality, ) -> Self
Creates a new datapoint value with a 32 bit unsigned integer value
pub fn new_i64(
datapoint_id: GCDatapointID,
timestamp_ns: u64,
value: i64,
quality: GCDatapointValueQuality,
) -> Self
pub fn new_i64( datapoint_id: GCDatapointID, timestamp_ns: u64, value: i64, quality: GCDatapointValueQuality, ) -> Self
Creates a new datapoint value with a 64 bit signed integer value
pub fn new_i32(
datapoint_id: GCDatapointID,
timestamp_ns: u64,
value: i32,
quality: GCDatapointValueQuality,
) -> Self
pub fn new_i32( datapoint_id: GCDatapointID, timestamp_ns: u64, value: i32, quality: GCDatapointValueQuality, ) -> Self
Creates a new datapoint value with a 32 bit signed integer value
pub fn new_f64(
datapoint_id: GCDatapointID,
timestamp_ns: u64,
value: f64,
quality: GCDatapointValueQuality,
) -> Self
pub fn new_f64( datapoint_id: GCDatapointID, timestamp_ns: u64, value: f64, quality: GCDatapointValueQuality, ) -> Self
Creates a new datapoint value with a 64 bit floating point value
pub fn new_f32(
datapoint_id: GCDatapointID,
timestamp_ns: u64,
value: f32,
quality: GCDatapointValueQuality,
) -> Self
pub fn new_f32( datapoint_id: GCDatapointID, timestamp_ns: u64, value: f32, quality: GCDatapointValueQuality, ) -> Self
Creates a new datapoint value with a 32 bit floating point value
pub fn new_double_point(
datapoint_id: GCDatapointID,
timestamp_ns: u64,
value: u8,
quality: GCDatapointValueQuality,
) -> Self
pub fn new_double_point( datapoint_id: GCDatapointID, timestamp_ns: u64, value: u8, quality: GCDatapointValueQuality, ) -> Self
Creates a new datapoint value with a double point value
pub fn new_byte(
datapoint_id: GCDatapointID,
timestamp_ns: u64,
value: bool,
quality: GCDatapointValueQuality,
) -> Self
pub fn new_byte( datapoint_id: GCDatapointID, timestamp_ns: u64, value: bool, quality: GCDatapointValueQuality, ) -> Self
Creates a new datapoint value with a boolean value
pub fn get_value(&self) -> Result<GCDatapointValueType, GCPluginABIError>
pub fn get_value(&self) -> Result<GCDatapointValueType, GCPluginABIError>
Get the value of the current datapoint This method may add a slight overhead to the execution time, if the value is already known it is recommended to use the specific getter methods It returns an error if the value is not supported or unknown
pub fn set_value(&mut self, value: GCDatapointValueType)
pub fn set_value(&mut self, value: GCDatapointValueType)
Set the value of the current datapoint TODO: This can maybe be optimized by using unsafe
pub fn get_value_bool(&self) -> Option<bool>
pub fn get_value_bool(&self) -> Option<bool>
Get the value of the current datapoint as a boolean Returns None if the value is not a boolean
pub fn get_value_double_point(&self) -> Option<u8>
pub fn get_value_double_point(&self) -> Option<u8>
Get the value of the current datapoint as a double point Returns None if the value is not a double point
pub fn get_value_i64(&self) -> Option<i64>
pub fn get_value_i64(&self) -> Option<i64>
Get the value of the current datapoint as a 64 bit signed integer Returns None if the value is not a 64 bit signed integer
pub fn get_value_i32(&self) -> Option<i32>
pub fn get_value_i32(&self) -> Option<i32>
Get the value of the current datapoint as a 32 bit signed integer Returns None if the value is not a 32 bit signed integer
pub fn get_value_u32(&self) -> Option<u32>
pub fn get_value_u32(&self) -> Option<u32>
Get the value of the current datapoint as a 32 bit unsigned integer Returns None if the value is not a 32 bit unsigned integer
pub fn get_value_u64(&self) -> Option<u64>
pub fn get_value_u64(&self) -> Option<u64>
Get the value of the current datapoint as a 64 bit unsigned integer Returns None if the value is not a 64 bit unsigned integer
pub fn get_value_f64(&self) -> Option<f64>
pub fn get_value_f64(&self) -> Option<f64>
Get the value of the current datapoint as a 64 bit floating point Returns None if the value is not a 64 bit floating point
pub fn get_value_f32(&self) -> Option<f32>
pub fn get_value_f32(&self) -> Option<f32>
Get the value of the current datapoint as a 32 bit floating point Returns None if the value is not a 32 bit floating point
pub fn get_value_timestamp_ns(&self) -> Option<u64>
pub fn get_value_timestamp_ns(&self) -> Option<u64>
Get the value of the current datapoint as a timestamp in nanoseconds Returns None if the value is not a timestamp
pub fn get_value_bytes(&self) -> Option<Vec<u8>>
pub fn get_value_bytes(&self) -> Option<Vec<u8>>
Get the value of the current datapoint as a byte array Returns None if the value is not a byte array
pub fn get_timestamp(&self) -> u64
pub fn get_timestamp(&self) -> u64
Returns the timestamp of the datapoint value
pub fn get_id(&self) -> GCDatapointID
pub fn get_id(&self) -> GCDatapointID
Returns the datapoint id of the datapoint value
pub fn get_quality(&self) -> GCDatapointValueQuality
pub fn get_quality(&self) -> GCDatapointValueQuality
Returns the quality of the datapoint value
pub fn as_raw(&self) -> sGCDatapointValue
pub fn as_raw(&self) -> sGCDatapointValue
Returns the raw representation of the datapoint value
Trait Implementations§
§impl Clone for GCDatapointValue
impl Clone for GCDatapointValue
§fn clone(&self) -> GCDatapointValue
fn clone(&self) -> GCDatapointValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more