Trait opcua_server::callbacks::AttributeGetter
source · [−]pub trait AttributeGetter {
fn get(
&mut self,
node_id: &NodeId,
timestamps_to_return: TimestampsToReturn,
attribute_id: AttributeId,
index_range: NumericRange,
data_encoding: &QualifiedName,
max_age: f64
) -> Result<Option<DataValue>, StatusCode>;
}
Expand description
An attribute getter trait is used to obtain the data value associated with the particular attribute id This allows server implementations to supply a value on demand, usually in response to a polling action such as a monitored item in a subscription.
node_id
is the node to which the node belongs
attribute_id
is the attribute of the node to fetch a value for
Use max_age
according to the OPC UA Part 4, Table 52 specification to determine how to return
a value:
- 0 = a new value
- time in ms for a value less than the specified age
- i32::max() or higher to fetch a cached value.
Required methods
fn get(
&mut self,
node_id: &NodeId,
timestamps_to_return: TimestampsToReturn,
attribute_id: AttributeId,
index_range: NumericRange,
data_encoding: &QualifiedName,
max_age: f64
) -> Result<Option<DataValue>, StatusCode>
fn get(
&mut self,
node_id: &NodeId,
timestamps_to_return: TimestampsToReturn,
attribute_id: AttributeId,
index_range: NumericRange,
data_encoding: &QualifiedName,
max_age: f64
) -> Result<Option<DataValue>, StatusCode>
Returns a data value of the specified attribute or none.