Struct opcua_server::address_space::variable::Variable
source · pub struct Variable { /* private fields */ }Implementations§
source§impl Variable
impl Variable
pub fn new<V>(
node_id: &NodeId,
browse_name: &str,
display_name: &str,
description: &str,
value: V
) -> Variablewhere
V: Into<Variant>,
pub fn new_with_data_type<V>(
node_id: &NodeId,
browse_name: &str,
display_name: &str,
description: &str,
data_type: DataTypeId,
value: V
) -> Variablewhere
V: Into<Variant>,
sourcepub fn new_data_value(
node_id: &NodeId,
browse_name: &str,
display_name: &str,
description: &str,
data_type: DataTypeId,
value: DataValue
) -> Variable
pub fn new_data_value(
node_id: &NodeId,
browse_name: &str,
display_name: &str,
description: &str,
data_type: DataTypeId,
value: DataValue
) -> Variable
Constructs a new variable with the specified id, name, type and value
pub fn is_valid(&self) -> bool
pub fn value(&self) -> DataValue
sourcepub fn set_value_direct<V>(&mut self, now: &DateTime, value: V)where
V: Into<Variant>,
pub fn set_value_direct<V>(&mut self, now: &DateTime, value: V)where
V: Into<Variant>,
Sets the variable’s value directly but first test to see if it has changed. If the value has not changed the existing timestamps are preserved.
sourcepub fn set_value_getter(
&mut self,
getter: Arc<Mutex<dyn AttributeGetter + Send>>
)
pub fn set_value_getter(
&mut self,
getter: Arc<Mutex<dyn AttributeGetter + Send>>
)
Sets a getter function that will be called to get the value of this variable.
sourcepub fn set_value_setter(
&mut self,
setter: Arc<Mutex<dyn AttributeSetter + Send>>
)
pub fn set_value_setter(
&mut self,
setter: Arc<Mutex<dyn AttributeSetter + Send>>
)
Sets a setter function that will be called to set the value of this variable. Note you most likely want to set the corresponding getter too otherwise you will never get back the values you set otherwise.
sourcepub fn minimum_sampling_interval(&self) -> Option<i32>
pub fn minimum_sampling_interval(&self) -> Option<i32>
Gets the minimum sampling interval, if the attribute was set
sourcepub fn set_minimum_sampling_interval(&mut self, minimum_sampling_interval: i32)
pub fn set_minimum_sampling_interval(&mut self, minimum_sampling_interval: i32)
Sets the minimum sampling interval
Specifies in milliseconds how fast the server can reasonably sample the value for changes
The value 0 means server is to monitor the value continuously. The value -1 means indeterminate.