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§
fn interface(&self) -> Result<&IOPCServer>
Provided Methods§
Sourcefn 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 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 identificationactive- Whether the group should initially be activeclient_handle- Client-assigned handle for the groupupdate_rate- Requested update rate in millisecondslocale_id- Locale ID for text stringstime_bias- Time zone bias in minutes from UTCpercent_deadband- Percent change required to trigger updates
§Returns
The newly created group object
§Errors
Returns E_POINTER if group creation fails
Sourcefn get_status(&self) -> Result<RemotePointer<tagOPCSERVERSTATUS>>
fn get_status(&self) -> Result<RemotePointer<tagOPCSERVERSTATUS>>
Gets the current server status.
§Returns
Server status structure containing vendor info, time, state, and group counts
Sourcefn remove_group(&self, server_handle: u32, force: bool) -> Result<()>
fn remove_group(&self, server_handle: u32, force: bool) -> Result<()>
Removes a group from the server.
§Arguments
server_handle- Server’s handle for the groupforce- If true, remove even if clients are connected