[−][src]Struct opcua_server::server::Server
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
impl Server[src]
pub fn new(config: ServerConfig) -> Server[src]
Creates a new Server instance, initialising it from a ServerConfig.
pub fn run(self)[src]
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.
pub fn run_server(server: Arc<RwLock<Server>>)[src]
Runs the supplied server and blocks until it completes either by aborting or by error.
pub fn server_state(&self) -> Arc<RwLock<ServerState>>[src]
Returns the current ServerState for the server.
pub fn certificate_store(&self) -> Arc<RwLock<CertificateStore>>[src]
Returns the CertificateStore for the server.
pub fn address_space(&self) -> Arc<RwLock<AddressSpace>>[src]
Returns the AddressSpace for the server.
pub fn connections(&self) -> Arc<RwLock<Connections>>[src]
Returns the Connections for the server.
pub fn server_metrics(&self) -> Arc<RwLock<ServerMetrics>>[src]
Returns the ServerMetrics for the server.
pub fn abort(&mut self)[src]
Sets a flag telling the running server to abort. The abort will happen asynchronously after all sessions have disconnected.
pub fn add_polling_action<F>(&mut self, interval_ms: u64, action: F) where
F: Fn() + Send + Sync + 'static, [src]
F: Fn() + Send + Sync + 'static,
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.
pub fn new_transport(&self) -> TcpTransport[src]
Create a new transport.
Trait Implementations
impl From<ServerConfig> for Server[src]
fn from(config: ServerConfig) -> Server[src]
Auto Trait Implementations
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,