pub struct DataPointDef {
pub id: String,
pub name: String,
pub description: String,
pub data_type: DataType,
pub access: AccessMode,
pub units: Option<String>,
pub min_value: Option<f64>,
pub max_value: Option<f64>,
pub default_value: Option<Value>,
pub address: Option<Address>,
}Expand description
Data point definition (metadata).
Fields§
§id: StringPoint ID.
name: StringHuman-readable name.
description: StringDescription.
data_type: DataTypeData type.
access: AccessModeAccess mode.
units: Option<String>Engineering units.
min_value: Option<f64>Minimum value.
max_value: Option<f64>Maximum value.
default_value: Option<Value>Default value.
address: Option<Address>Protocol-specific address.
Implementations§
Source§impl DataPointDef
impl DataPointDef
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
data_type: DataType,
) -> DataPointDef
pub fn new( id: impl Into<String>, name: impl Into<String>, data_type: DataType, ) -> DataPointDef
Create a new data point definition.
Sourcepub fn with_access(self, access: AccessMode) -> DataPointDef
pub fn with_access(self, access: AccessMode) -> DataPointDef
Set access mode.
Sourcepub fn with_range(self, min: f64, max: f64) -> DataPointDef
pub fn with_range(self, min: f64, max: f64) -> DataPointDef
Set value range.
Sourcepub fn with_units(self, units: impl Into<String>) -> DataPointDef
pub fn with_units(self, units: impl Into<String>) -> DataPointDef
Set units.
Sourcepub fn with_address(self, address: Address) -> DataPointDef
pub fn with_address(self, address: Address) -> DataPointDef
Set address.
Trait Implementations§
Source§impl Clone for DataPointDef
impl Clone for DataPointDef
Source§fn clone(&self) -> DataPointDef
fn clone(&self) -> DataPointDef
Returns a duplicate 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 DataPointDef
impl Debug for DataPointDef
Source§impl<'de> Deserialize<'de> for DataPointDef
impl<'de> Deserialize<'de> for DataPointDef
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DataPointDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DataPointDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<DataPointBuilder> for DataPointDef
impl From<DataPointBuilder> for DataPointDef
Source§fn from(builder: DataPointBuilder) -> DataPointDef
fn from(builder: DataPointBuilder) -> DataPointDef
Converts to this type from the input type.
Source§impl Serialize for DataPointDef
impl Serialize for DataPointDef
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for DataPointDef
impl RefUnwindSafe for DataPointDef
impl Send for DataPointDef
impl Sync for DataPointDef
impl Unpin for DataPointDef
impl UnsafeUnpin for DataPointDef
impl UnwindSafe for DataPointDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more