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) -> Self
pub fn new<T, S>(node_id: &NodeId, browse_name: T, display_name: S) -> Self
Creates a builder for a node. All nodes are required to su
pub fn get_node_id(&self) -> NodeId
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) -> Selfwhere
V: Into<LocalizedText>,
pub fn description<V>(self, description: V) -> Selfwhere
V: Into<LocalizedText>,
Sets the description of the node
Sourcepub fn reference<T>(
self,
node_id: T,
reference_type_id: ReferenceTypeId,
reference_direction: ReferenceDirection,
) -> Self
pub fn reference<T>( self, node_id: T, reference_type_id: ReferenceTypeId, reference_direction: ReferenceDirection, ) -> Self
Adds a reference to the node
Sourcepub fn organizes<T>(self, organizes_id: T) -> Self
pub fn organizes<T>(self, organizes_id: T) -> Self
Indicates this node organizes another node by its id.
Sourcepub fn organized_by<T>(self, organized_by_id: T) -> Self
pub fn organized_by<T>(self, organized_by_id: T) -> Self
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 AddressSpace) -> bool
pub fn insert(self, address_space: &mut AddressSpace) -> 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
pub fn component_of<T>(self, component_of_id: T) -> Self
pub fn has_component<T>(self, has_component_id: T) -> Self
Source§impl VariableBuilder
impl VariableBuilder
pub fn has_property<T>(self, has_component_id: T) -> Self
pub fn property_of<T>(self, component_of_id: T) -> Self
Source§impl VariableBuilder
impl VariableBuilder
Sourcepub fn historizing(self, historizing: bool) -> Self
pub fn historizing(self, historizing: bool) -> Self
Sets the historizing flag for the variable.
Sourcepub fn access_level(self, access_level: AccessLevel) -> Self
pub fn access_level(self, access_level: AccessLevel) -> Self
Sets the access level for the variable.
Sourcepub fn user_access_level(self, user_access_level: UserAccessLevel) -> Self
pub fn user_access_level(self, user_access_level: UserAccessLevel) -> Self
Sets the user access level for the variable.
Sourcepub fn value_rank(self, value_rank: i32) -> Self
pub fn value_rank(self, value_rank: i32) -> Self
Sets the value rank for the variable.
Sourcepub fn array_dimensions(self, array_dimensions: &[u32]) -> Self
pub fn array_dimensions(self, array_dimensions: &[u32]) -> Self
Sets the array dimensions for the variable.
Sourcepub fn history_readable(self) -> Self
pub fn history_readable(self) -> Self
Makes the variable history-readable
Sourcepub fn history_updatable(self) -> Self
pub fn history_updatable(self) -> Self
Makes the variable history-updateable
Sourcepub fn minimum_sampling_interval(self, minimum_sampling_interval: f64) -> Self
pub fn minimum_sampling_interval(self, minimum_sampling_interval: f64) -> Self
Sets the minimum sampling interval for the variable.
Sourcepub fn value_getter(
self,
getter: Arc<Mutex<dyn AttributeGetter + Send>>,
) -> Self
pub fn value_getter( self, getter: Arc<Mutex<dyn AttributeGetter + Send>>, ) -> Self
Sets a value getter function for the variable. Whenever the value of a variable needs to be fetched (e.g. from a monitored item subscription), this trait will be called to get the value.
Sourcepub fn value_setter(
self,
setter: Arc<Mutex<dyn AttributeSetter + Send>>,
) -> Self
pub fn value_setter( self, setter: Arc<Mutex<dyn AttributeSetter + Send>>, ) -> Self
Sets a value setter function for the variable. Whenever the value of a variable is set via a service, this trait will be called to set the value. It is up to the implementation to decide what to do if that happens.
Sourcepub fn has_type_definition<T>(self, type_id: T) -> Self
pub fn has_type_definition<T>(self, type_id: T) -> Self
Add a reference to the variable indicating it has a type of another node.
Sourcepub fn has_modelling_rule<T>(self, type_id: T) -> Self
pub fn has_modelling_rule<T>(self, type_id: T) -> Self
Add a reference to the variable indicating it has a modelling rule of another node.