ServerTrait

Trait ServerTrait 

Source
pub trait ServerTrait<Group: TryFrom<IUnknown, Error = Error>> {
    // Required method
    fn interface(&self) -> Result<&IOPCServer>;

    // Provided methods
    fn add_group(
        &self,
        name: &str,
        active: bool,
        client_handle: u32,
        update_rate: u32,
        locale_id: u32,
        time_bias: i32,
        percent_deadband: f32,
        revised_percent_deadband: &mut u32,
        server_handle: &mut u32,
    ) -> Result<Group> { ... }
    fn get_status(&self) -> Result<RemotePointer<tagOPCSERVERSTATUS>> { ... }
    fn remove_group(&self, server_handle: u32, force: bool) -> Result<()> { ... }
    fn create_group_enumerator(
        &self,
        scope: tagOPCENUMSCOPE,
    ) -> Result<GroupIterator<Group>> { ... }
    fn create_group_name_enumerator(
        &self,
        scope: tagOPCENUMSCOPE,
    ) -> Result<StringIterator> { ... }
}
Expand description

OPC Server management functionality.

Provides methods to create and manage groups within an OPC server, as well as monitor server status and enumerate existing groups.

Required Methods§

Provided Methods§

Source

fn add_group( &self, name: &str, active: bool, client_handle: u32, update_rate: u32, locale_id: u32, time_bias: i32, percent_deadband: f32, revised_percent_deadband: &mut u32, server_handle: &mut u32, ) -> Result<Group>

Adds a new group to the OPC server.

§Arguments
  • name - Group name for identification
  • active - Whether the group should initially be active
  • client_handle - Client-assigned handle for the group
  • update_rate - Requested update rate in milliseconds
  • locale_id - Locale ID for text strings
  • time_bias - Time zone bias in minutes from UTC
  • percent_deadband - Percent change required to trigger updates
§Returns

The newly created group object

§Errors

Returns E_POINTER if group creation fails

Source

fn get_status(&self) -> Result<RemotePointer<tagOPCSERVERSTATUS>>

Gets the current server status.

§Returns

Server status structure containing vendor info, time, state, and group counts

Source

fn remove_group(&self, server_handle: u32, force: bool) -> Result<()>

Removes a group from the server.

§Arguments
  • server_handle - Server’s handle for the group
  • force - If true, remove even if clients are connected
Source

fn create_group_enumerator( &self, scope: tagOPCENUMSCOPE, ) -> Result<GroupIterator<Group>>

Creates an enumerator for groups.

§Arguments
  • scope - Scope of groups to enumerate (public, private, or all)
§Returns

Enumerator interface for iterating through groups

Source

fn create_group_name_enumerator( &self, scope: tagOPCENUMSCOPE, ) -> Result<StringIterator>

Creates an enumerator for group names.

§Arguments
  • scope - Scope of group names to enumerate (public, private, or all)
§Returns

Enumerator interface for iterating through group names

Implementors§

Source§

impl ServerTrait<Group> for opc_da::client::v1::Server

Source§

impl ServerTrait<Group> for opc_da::client::v2::Server

Source§

impl ServerTrait<Group> for opc_da::client::v3::Server