Struct ServerBuilder

Source
pub struct ServerBuilder { /* private fields */ }
Expand description

Builder for Server.

Use this to specify additional options when building an OPC UA server.

§Examples

use open62541::ServerBuilder;

let (server, runner) = ServerBuilder::default()
    .server_urls(&["opc.tcp://localhost:4840"])
    .build();

Implementations§

Source§

impl ServerBuilder

Source

pub fn minimal(port_number: u16, certificate: Option<&[u8]>) -> Self

Creates builder from minimal server config.

Source

pub fn port(self, port_number: u16) -> Self

Sets server port number.

This is a shortcut for setting the corresponding server URL opc.tcp://:<port> and thus may overwrite any previously set server URLs from server_urls().

Source

pub fn server_urls(self, server_urls: &[&str]) -> Self

Sets server URLs.

§Panics

The strings must not contain any NUL bytes.

Source

pub fn accept_all(self) -> Self

Disables client certificate checks.

Note that this disables all certificate verification of client communications. Use only when clients can be identified in some other way, or identity is not relevant.

Source

pub fn access_control(self, access_control: impl AccessControl) -> Result<Self>

Applies access control.

See AccessControl for available implementations.

§Errors

This fails when the access control instance cannot be applied.

Source

pub fn build(self) -> (Server, ServerRunner)

Builds OPC UA server.

Trait Implementations§

Source§

impl Debug for ServerBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ServerBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.