pub struct DataPointBuilder { /* private fields */ }Expand description
Builder for data point definitions with chainable API.
Implementations§
Source§impl DataPointBuilder
impl DataPointBuilder
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
data_type: DataType,
) -> DataPointBuilder
pub fn new( id: impl Into<String>, name: impl Into<String>, data_type: DataType, ) -> DataPointBuilder
Create a new data point builder.
Sourcepub fn description(self, description: impl Into<String>) -> DataPointBuilder
pub fn description(self, description: impl Into<String>) -> DataPointBuilder
Set the description.
Sourcepub fn access(self, access: AccessMode) -> DataPointBuilder
pub fn access(self, access: AccessMode) -> DataPointBuilder
Set the access mode.
Sourcepub fn read_only(self) -> DataPointBuilder
pub fn read_only(self) -> DataPointBuilder
Set read-only access.
Sourcepub fn write_only(self) -> DataPointBuilder
pub fn write_only(self) -> DataPointBuilder
Set write-only access.
Sourcepub fn units(self, units: impl Into<String>) -> DataPointBuilder
pub fn units(self, units: impl Into<String>) -> DataPointBuilder
Set the engineering units.
Sourcepub fn range(self, min: f64, max: f64) -> DataPointBuilder
pub fn range(self, min: f64, max: f64) -> DataPointBuilder
Set the value range.
Sourcepub fn min(self, min: f64) -> DataPointBuilder
pub fn min(self, min: f64) -> DataPointBuilder
Set the minimum value.
Sourcepub fn max(self, max: f64) -> DataPointBuilder
pub fn max(self, max: f64) -> DataPointBuilder
Set the maximum value.
Sourcepub fn default_value(self, value: impl Into<Value>) -> DataPointBuilder
pub fn default_value(self, value: impl Into<Value>) -> DataPointBuilder
Set the default value.
Sourcepub fn address(self, address: Address) -> DataPointBuilder
pub fn address(self, address: Address) -> DataPointBuilder
Set the protocol-specific address.
Sourcepub fn build(self) -> DataPointDef
pub fn build(self) -> DataPointDef
Build the data point definition.
Trait Implementations§
Source§impl Clone for DataPointBuilder
impl Clone for DataPointBuilder
Source§fn clone(&self) -> DataPointBuilder
fn clone(&self) -> DataPointBuilder
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 DataPointBuilder
impl Debug for DataPointBuilder
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.
Auto Trait Implementations§
impl Freeze for DataPointBuilder
impl RefUnwindSafe for DataPointBuilder
impl Send for DataPointBuilder
impl Sync for DataPointBuilder
impl Unpin for DataPointBuilder
impl UnsafeUnpin for DataPointBuilder
impl UnwindSafe for DataPointBuilder
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