pub trait AttributeService: Service {
// Required methods
fn read(
&self,
nodes_to_read: &[ReadValueId],
timestamps_to_return: TimestampsToReturn,
max_age: f64,
) -> Result<Vec<DataValue>, StatusCode>;
fn history_read(
&self,
history_read_details: HistoryReadAction,
timestamps_to_return: TimestampsToReturn,
release_continuation_points: bool,
nodes_to_read: &[HistoryReadValueId],
) -> Result<Vec<HistoryReadResult>, StatusCode>;
fn write(
&self,
nodes_to_write: &[WriteValue],
) -> Result<Vec<StatusCode>, StatusCode>;
fn history_update(
&self,
history_update_details: &[HistoryUpdateAction],
) -> Result<Vec<HistoryUpdateResult>, StatusCode>;
}Expand description
Attribute Service set
Required Methods§
Sourcefn read(
&self,
nodes_to_read: &[ReadValueId],
timestamps_to_return: TimestampsToReturn,
max_age: f64,
) -> Result<Vec<DataValue>, StatusCode>
fn read( &self, nodes_to_read: &[ReadValueId], timestamps_to_return: TimestampsToReturn, max_age: f64, ) -> Result<Vec<DataValue>, StatusCode>
Reads the value of nodes by sending a ReadRequest to the server.
See OPC UA Part 4 - Services 5.10.2 for complete description of the service and error responses.
§Arguments
nodes_to_read- A list ofReadValueIdto be read by the server.timestamps_to_return- TheTimestampsToReturnfor each node, Both, Server, Source or Nonemax_age- The maximum age of value to read in milliseconds. Read the service description for details. Basically it will attempt to read a value within the age range or attempt to read a new value. If 0 the server will attempt to read a new value from the datasource. If set toi32::MAXor greater, the server shall attempt to get a cached value.
§Returns
Ok(Vec<DataValue>)- A list ofDataValuecorresponding to each read operation.Err(StatusCode)- Status code reason for failure.
Sourcefn history_read(
&self,
history_read_details: HistoryReadAction,
timestamps_to_return: TimestampsToReturn,
release_continuation_points: bool,
nodes_to_read: &[HistoryReadValueId],
) -> Result<Vec<HistoryReadResult>, StatusCode>
fn history_read( &self, history_read_details: HistoryReadAction, timestamps_to_return: TimestampsToReturn, release_continuation_points: bool, nodes_to_read: &[HistoryReadValueId], ) -> Result<Vec<HistoryReadResult>, StatusCode>
Reads historical values or events of one or more nodes. The caller is expected to provide a HistoryReadAction enum which must be one of the following:
- HistoryReadAction::ReadEventDetails
- HistoryReadAction::ReadRawModifiedDetails
- HistoryReadAction::ReadProcessedDetails
- HistoryReadAction::ReadAtTimeDetails
See OPC UA Part 4 - Services 5.10.3 for complete description of the service and error responses.
§Arguments
history_read_details- A history read operation encoded in anExtensionObject.timestamps_to_return- Enumeration of which timestamps to return.release_continuation_points- Flag indicating whether to release the continuation point for the operation.nodes_to_read- The list ofHistoryReadValueIdof the nodes to apply the history read operation to.
§Returns
Ok(Vec<HistoryReadResult>)- A list ofHistoryReadResultresults corresponding to history read operation.Err(StatusCode)- Status code reason for failure.
Sourcefn write(
&self,
nodes_to_write: &[WriteValue],
) -> Result<Vec<StatusCode>, StatusCode>
fn write( &self, nodes_to_write: &[WriteValue], ) -> Result<Vec<StatusCode>, StatusCode>
Writes values to nodes by sending a WriteRequest to the server. Note that some servers may reject DataValues
containing source or server timestamps.
See OPC UA Part 4 - Services 5.10.4 for complete description of the service and error responses.
§Arguments
nodes_to_write- A list ofWriteValueto be sent to the server.
§Returns
Ok(Vec<StatusCode>)- A list ofStatusCoderesults corresponding to each write operation.Err(StatusCode)- Status code reason for failure.
Sourcefn history_update(
&self,
history_update_details: &[HistoryUpdateAction],
) -> Result<Vec<HistoryUpdateResult>, StatusCode>
fn history_update( &self, history_update_details: &[HistoryUpdateAction], ) -> Result<Vec<HistoryUpdateResult>, StatusCode>
Updates historical values. The caller is expected to provide one or more history update operations in a slice of HistoryUpdateAction enums which are one of the following:
- UpdateDataDetails
- UpdateStructureDataDetails
- UpdateEventDetails
- DeleteRawModifiedDetails
- DeleteAtTimeDetails
- DeleteEventDetails
See OPC UA Part 4 - Services 5.10.5 for complete description of the service and error responses.
§Arguments
history_update_details- A list of history update operations each encoded as anExtensionObject.
§Returns
Ok(Vec<ClientHistoryUpdateResult>)- A list ofClientHistoryUpdateResultresults corresponding to history update operation.Err(StatusCode)- Status code reason for failure.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.