Struct opcua_server::builder::ServerBuilder
source · 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§
source§impl ServerBuilder
impl ServerBuilder
pub fn new() -> Self
sourcepub fn new_anonymous<T>(application_name: T) -> Selfwhere
T: Into<String>,
pub fn new_anonymous<T>(application_name: T) -> Selfwhere
T: Into<String>,
Creates a simple endpoint that accepts anonymous connections
sourcepub fn new_sample() -> ServerBuilder
pub fn new_sample() -> ServerBuilder
Sample mode turns on everything including a hard coded user/pass
sourcepub fn server(self) -> Option<Server>
pub fn server(self) -> Option<Server>
Yields a [Client] from the values set by the builder. If the builder is not in a valid state
it will return None.
sourcepub fn config(self) -> ServerConfig
pub fn config(self) -> ServerConfig
Yields a [ClientConfig] from the values set by the builder.
pub fn is_valid(&self) -> bool
sourcepub fn application_name<T>(self, application_name: T) -> Selfwhere
T: Into<String>,
pub fn application_name<T>(self, application_name: T) -> Selfwhere
T: Into<String>,
Sets the application name.
sourcepub fn application_uri<T>(self, application_uri: T) -> Selfwhere
T: Into<String>,
pub fn application_uri<T>(self, application_uri: T) -> Selfwhere
T: Into<String>,
Sets the application uri
sourcepub fn product_uri<T>(self, product_uri: T) -> Selfwhere
T: Into<String>,
pub fn product_uri<T>(self, product_uri: T) -> Selfwhere
T: Into<String>,
Sets the product uri.
sourcepub fn create_sample_keypair(self, create_sample_keypair: bool) -> Self
pub fn create_sample_keypair(self, create_sample_keypair: bool) -> Self
Sets whether the client should generate its own key pair if there is none found in the pki directory.
sourcepub fn pki_dir<T>(self, pki_dir: T) -> Selfwhere
T: Into<PathBuf>,
pub fn pki_dir<T>(self, pki_dir: T) -> Selfwhere
T: Into<PathBuf>,
Sets the pki directory where client’s own key pair is stored and where /trusted and
/rejected server certificates are stored.
sourcepub fn endpoint<T>(self, endpoint_id: T, endpoint: ServerEndpoint) -> Selfwhere
T: Into<String>,
pub fn endpoint<T>(self, endpoint_id: T, endpoint: ServerEndpoint) -> Selfwhere
T: Into<String>,
Adds an endpoint to the list of endpoints the client knows of.
sourcepub fn endpoints<T>(self, endpoints: Vec<(T, ServerEndpoint)>) -> Selfwhere
T: Into<String>,
pub fn endpoints<T>(self, endpoints: Vec<(T, ServerEndpoint)>) -> Selfwhere
T: Into<String>,
Adds multiple endpoints to the list of endpoints the client knows of.
sourcepub fn user_token<T>(self, user_token_id: T, user_token: ServerUserToken) -> Selfwhere
T: Into<String>,
pub fn user_token<T>(self, user_token_id: T, user_token: ServerUserToken) -> Selfwhere
T: Into<String>,
Adds a user token to the server.
sourcepub fn discovery_server_url(self, discovery_server_url: Option<String>) -> Self
pub fn discovery_server_url(self, discovery_server_url: Option<String>) -> Self
Sets the discovery server url that this server shall attempt to register itself with.
sourcepub fn host_and_port<T>(self, host: T, port: u16) -> Selfwhere
T: Into<String>,
pub fn host_and_port<T>(self, host: T, port: u16) -> Selfwhere
T: Into<String>,
Sets the hostname and port to listen on
sourcepub fn discovery_url<T>(self, discovery_url: T) -> Selfwhere
T: Into<String>,
pub fn discovery_url<T>(self, discovery_url: T) -> Selfwhere
T: Into<String>,
Discovery endpoint url - the url of this server used by clients to get endpoints.
sourcepub fn max_subscriptions(self, max_subscriptions: u32) -> Self
pub fn max_subscriptions(self, max_subscriptions: u32) -> Self
Maximum number of subscriptions in a session
sourcepub fn max_array_length(self, max_array_length: u32) -> Self
pub fn max_array_length(self, max_array_length: u32) -> Self
Max array length in elements
sourcepub fn max_string_length(self, max_string_length: u32) -> Self
pub fn max_string_length(self, max_string_length: u32) -> Self
Max string length in characters
sourcepub fn max_byte_string_length(self, max_byte_string_length: u32) -> Self
pub fn max_byte_string_length(self, max_byte_string_length: u32) -> Self
Max bytestring length in bytes