pub struct VariableBuilder { /* private fields */ }Expand description
A builder for constructing a node of same name. This can be used as an easy way to create a node and the references it has to another node in a simple fashion.
Implementations§
Source§impl VariableBuilder
impl VariableBuilder
Sourcepub fn new<T, S>(
node_id: &NodeId,
browse_name: T,
display_name: S,
) -> VariableBuilder
pub fn new<T, S>( node_id: &NodeId, browse_name: T, display_name: S, ) -> VariableBuilder
Creates a builder for a node. All nodes are required to su
Sourcepub fn get_node_id(&self) -> &NodeId
pub fn get_node_id(&self) -> &NodeId
Get the node ID of the node being built.
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Tests that the builder is in a valid state to build or insert the node.
Sourcepub fn description<V>(self, description: V) -> VariableBuilderwhere
V: Into<LocalizedText>,
pub fn description<V>(self, description: V) -> VariableBuilderwhere
V: Into<LocalizedText>,
Sets the description of the node
Sourcepub fn reference<T>(
self,
node_id: T,
reference_type_id: ReferenceTypeId,
reference_direction: ReferenceDirection,
) -> VariableBuilder
pub fn reference<T>( self, node_id: T, reference_type_id: ReferenceTypeId, reference_direction: ReferenceDirection, ) -> VariableBuilder
Adds a reference to the node
Sourcepub fn organizes<T>(self, organizes_id: T) -> VariableBuilder
pub fn organizes<T>(self, organizes_id: T) -> VariableBuilder
Indicates this node organizes another node by its id.
Sourcepub fn organized_by<T>(self, organized_by_id: T) -> VariableBuilder
pub fn organized_by<T>(self, organized_by_id: T) -> VariableBuilder
Indicates this node is organised by another node by its id
Sourcepub fn build(self) -> Variable
pub fn build(self) -> Variable
Yields a built node. This function will panic if the node is invalid. Note that calling this function discards any references for the node, so there is no purpose in adding references if you intend to call this method.
Sourcepub fn insert(self, address_space: &mut impl NodeInsertTarget) -> bool
pub fn insert(self, address_space: &mut impl NodeInsertTarget) -> bool
Inserts the node into the address space, including references. This function will panic if the node is in an invalid state.
Source§impl VariableBuilder
impl VariableBuilder
Sourcepub fn component_of<T>(self, component_of_id: T) -> VariableBuilder
pub fn component_of<T>(self, component_of_id: T) -> VariableBuilder
Add an inverse HasComponent reference to the
given node.
Sourcepub fn has_component<T>(self, has_component_id: T) -> VariableBuilder
pub fn has_component<T>(self, has_component_id: T) -> VariableBuilder
Add a HasComponent reference to the
given node.
Source§impl VariableBuilder
impl VariableBuilder
Sourcepub fn has_property<T>(self, has_component_id: T) -> VariableBuilder
pub fn has_property<T>(self, has_component_id: T) -> VariableBuilder
Add a HasProperty reference to the given node.
Sourcepub fn property_of<T>(self, component_of_id: T) -> VariableBuilder
pub fn property_of<T>(self, component_of_id: T) -> VariableBuilder
Add an inverse HasProperty reference to the given node.
Source§impl VariableBuilder
impl VariableBuilder
Sourcepub fn value(self, value: impl Into<Variant>) -> VariableBuilder
pub fn value(self, value: impl Into<Variant>) -> VariableBuilder
Sets the value of the variable.
Sourcepub fn data_type(self, data_type: impl Into<NodeId>) -> VariableBuilder
pub fn data_type(self, data_type: impl Into<NodeId>) -> VariableBuilder
Sets the data type of the variable.
Sourcepub fn historizing(self, historizing: bool) -> VariableBuilder
pub fn historizing(self, historizing: bool) -> VariableBuilder
Sets the historizing flag for the variable.
Sourcepub fn access_level(self, access_level: AccessLevel) -> VariableBuilder
pub fn access_level(self, access_level: AccessLevel) -> VariableBuilder
Sets the access level for the variable.
Sourcepub fn user_access_level(
self,
user_access_level: AccessLevel,
) -> VariableBuilder
pub fn user_access_level( self, user_access_level: AccessLevel, ) -> VariableBuilder
Sets the user access level for the variable.
Sourcepub fn value_rank(self, value_rank: i32) -> VariableBuilder
pub fn value_rank(self, value_rank: i32) -> VariableBuilder
Sets the value rank for the variable.
Sourcepub fn array_dimensions(self, array_dimensions: &[u32]) -> VariableBuilder
pub fn array_dimensions(self, array_dimensions: &[u32]) -> VariableBuilder
Sets the array dimensions for the variable.
Sourcepub fn write_mask(self, write_mask: WriteMask) -> VariableBuilder
pub fn write_mask(self, write_mask: WriteMask) -> VariableBuilder
Set the write mask for this variable.
Sourcepub fn writable(self) -> VariableBuilder
pub fn writable(self) -> VariableBuilder
Makes the variable writable (by default it isn’t)
Sourcepub fn history_readable(self) -> VariableBuilder
pub fn history_readable(self) -> VariableBuilder
Makes the variable history-readable
Sourcepub fn history_updatable(self) -> VariableBuilder
pub fn history_updatable(self) -> VariableBuilder
Makes the variable history-updateable
Sourcepub fn minimum_sampling_interval(
self,
minimum_sampling_interval: f64,
) -> VariableBuilder
pub fn minimum_sampling_interval( self, minimum_sampling_interval: f64, ) -> VariableBuilder
Sets the minimum sampling interval for the variable.
Sourcepub fn has_type_definition<T>(self, type_id: T) -> VariableBuilder
pub fn has_type_definition<T>(self, type_id: T) -> VariableBuilder
Add a reference to the variable indicating it has a type of another node.
Sourcepub fn has_modelling_rule<T>(self, type_id: T) -> VariableBuilder
pub fn has_modelling_rule<T>(self, type_id: T) -> VariableBuilder
Add a reference to the variable indicating it has a modelling rule of another node.