AttributeService

Trait AttributeService 

Source
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§

Source

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 of ReadValueId to be read by the server.
  • timestamps_to_return - The TimestampsToReturn for each node, Both, Server, Source or None
  • max_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 to i32::MAX or greater, the server shall attempt to get a cached value.
§Returns
  • Ok(Vec<DataValue>) - A list of DataValue corresponding to each read operation.
  • Err(StatusCode) - Status code reason for failure.
Source

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 an ExtensionObject.
  • 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 of HistoryReadValueId of the nodes to apply the history read operation to.
§Returns
  • Ok(Vec<HistoryReadResult>) - A list of HistoryReadResult results corresponding to history read operation.
  • Err(StatusCode) - Status code reason for failure.
Source

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 of WriteValue to be sent to the server.
§Returns
  • Ok(Vec<StatusCode>) - A list of StatusCode results corresponding to each write operation.
  • Err(StatusCode) - Status code reason for failure.
Source

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 an ExtensionObject.
§Returns
  • Ok(Vec<ClientHistoryUpdateResult>) - A list of ClientHistoryUpdateResult results 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.

Implementors§