pub struct DataPointRef { /* private fields */ }Expand description
A datapoint containing a reference to its timeseries metadata. Used in streaming responses to avoid cloning timeseries info for every datapoint.
Implementations§
Source§impl DataPointRef
impl DataPointRef
Sourcepub fn external_id(&self) -> Option<&str>
pub fn external_id(&self) -> Option<&str>
Get the external ID of the timeseries this datapoint belongs to, if it has one.
Sourcepub fn instance_id(&self) -> Option<&InstanceId>
pub fn instance_id(&self) -> Option<&InstanceId>
Get the data modelling instance ID of the timeseries this datapoint belongs to, if it has one.
Sourcepub fn original_id(&self) -> &IdentityOrInstance
pub fn original_id(&self) -> &IdentityOrInstance
Get the original ID used to identify the timeseries this datapoint belongs to in the request.
Sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Check if the timeseries this datapoint belongs to is of string type.
Sourcepub fn is_step(&self) -> bool
pub fn is_step(&self) -> bool
Check if the timeseries this datapoint belongs to is a step timeseries.
Sourcepub fn unit(&self) -> Option<&str>
pub fn unit(&self) -> Option<&str>
Get the unit of the timeseries this datapoint belongs to, if it has one.
Sourcepub fn unit_external_id(&self) -> Option<&str>
pub fn unit_external_id(&self) -> Option<&str>
Get the external ID of the unit of the timeseries this datapoint belongs to, if it has one.
Sourcepub fn into_datapoint(self) -> EitherDataPoint
pub fn into_datapoint(self) -> EitherDataPoint
Consume the reference and return the underlying datapoint, to avoid cloning.
Sourcepub fn datapoint(&self) -> &EitherDataPoint
pub fn datapoint(&self) -> &EitherDataPoint
Get a reference to the underlying datapoint.
Sourcepub fn as_numeric(&self) -> Option<&DatapointDouble>
pub fn as_numeric(&self) -> Option<&DatapointDouble>
Get a reference to the underlying datapoint as numeric, if it is of that type.
Sourcepub fn as_string(&self) -> Option<&DatapointString>
pub fn as_string(&self) -> Option<&DatapointString>
Get a reference to the underlying datapoint as string, if it is of that type.
Sourcepub fn as_aggregate(&self) -> Option<&DatapointAggregate>
pub fn as_aggregate(&self) -> Option<&DatapointAggregate>
Get a reference to the underlying datapoint as aggregate, if it is of that type.