pub struct Server { /* private fields */ }
Expand description

A Server represents a running instance of an OPC UA server. There can be more than one Server running at any given time providing they do not share the same ports.

A Server is initialised from a ServerConfig. The ServerConfig sets what port the server runs on, the endpoints it supports, the identity tokens it supports, identity tokens and so forth. A single server can offer multiple endpoints with different security policies. A server can also be configured to register itself with a discovery server.

Once the Server is configured, it is run by calling run which consumes the Server. Alternatively if you have reason to maintain access to the server object, you may call the static function run_server providing the server wrapped as Arc<RwLock<Server>>.

The server’s AddressSpace is initialised with the default OPC UA node set, but may also be extended with additional nodes representing folders, variables, methods etc.

The server’s CertificateStore manages the server’s private key and public certificate. It also manages public certificates of incoming clients and arranges them into trusted and rejected collections.

Implementations

Creates a new Server instance, initialising it from a ServerConfig.

Runs the server and blocks until it completes either by aborting or by error. Typically a server should be run on its own thread.

Calling this function consumes the server.

Runs the supplied server and blocks until it completes either by aborting or by error.

Allow the server to be run on a caller supplied runtime. If block is set, the task runs to completion (abort or by error), otherwise, the task is spawned and a join handle is returned by the function. Spawning might be suitable if the runtime is being used for other async tasks.

Returns the main server task - the loop that waits for connections and processes them.

Returns the current ServerState for the server.

Returns the CertificateStore for the server.

Returns the AddressSpace for the server.

Returns the Connections for the server.

Returns the ServerMetrics for the server.

Returns the single_threaded_executor for the server.

Sets a flag telling the running server to abort. The abort will happen asynchronously after all sessions have disconnected.

Creates a polling action that happens continuously on an interval while the server is running. For example, a server might run a polling action every 100ms to synchronous address space state between variables and their physical backends.

The function that is supplied does not take any arguments. It is expected that the implementation will move any variables into the function that are required to perform its action.

Create a new transport.

Trait Implementations

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.