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

The ServerBuilder is a builder for producing a Server. It is an alternative to constructing a ServerConfig from file or from scratch.

Implementations

Reads the config in as a starting point

Creates a simple endpoint that accepts anonymous connections

Creates and yields a builder which is configured with the sample server configuration. Use this for testing and similar reasons. Do not rely upon this in production code because it could change.

Yields a [Client] from the values set by the builder. If the builder is not in a valid state it will return None.

Yields a [ClientConfig] from the values set by the builder.

Test if the builder can yield a server with the configuration supplied.

Sets the application name.

Sets the application uri

Sets the product uri.

Sets whether the client should generate its own key pair if there is none found in the pki directory.

Sets a custom server certificate path. The path is required to be provided as a partial path relative to the PKI directory. If set, this path will be used to read the server certificate from disk. The certificate can be in either the .der or .pem format.

Sets a custom private key path. The path is required to be provided as a partial path relative to the PKI directory. If set, this path will be used to read the private key from disk.

Sets the pki directory where client’s own key pair is stored and where /trusted and /rejected server certificates are stored.

Adds an endpoint to the list of endpoints the client knows of.

Adds multiple endpoints to the list of endpoints the client knows of.

Adds a user token to the server.

Sets the discovery server url that this server shall attempt to register itself with.

Sets the hostname and port to listen on

Discovery endpoint urls - the urls of this server used by clients to get endpoints. If the url is relative, e.g. “/” then the code will make a url for you using the port/host settings as they are at the time this function is executed.

Set the maximum number of subscriptions in a session

Set the maximum number of monitored items per subscription

Set the max array length in elements

Set the max string length in characters, i.e. if you set max to 1000 characters, then with UTF-8 encoding potentially that’s 4000 bytes.

Set the max bytestring length in bytes

Sets the server to automatically trust client certs. This subverts the authentication during handshake, so only do this if you understand the risks.

Set that clients can modify the address space, i.e. they can add or remove nodes through the node management service. By default, they cannot.

Configures the server to use a single-threaded executor. The default executor uses a thread pool with a worker thread for each CPU core available on the system.

Configures the server to use a multi-threaded executor.

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.