pub struct ServerConfig {Show 22 fields
pub application_name: String,
pub application_uri: String,
pub product_uri: String,
pub create_sample_keypair: bool,
pub certificate_path: Option<PathBuf>,
pub private_key_path: Option<PathBuf>,
pub certificate_validation: CertificateValidation,
pub pki_dir: PathBuf,
pub discovery_server_url: Option<String>,
pub tcp_config: TcpConfig,
pub limits: Limits,
pub locale_ids: Vec<String>,
pub user_tokens: BTreeMap<String, ServerUserToken>,
pub discovery_urls: Vec<String>,
pub default_endpoint: Option<String>,
pub endpoints: BTreeMap<String, ServerEndpoint>,
pub subscription_poll_interval_ms: u64,
pub publish_timeout_default_ms: u64,
pub max_timeout_ms: u32,
pub max_secure_channel_token_lifetime_ms: u32,
pub max_session_timeout_ms: u64,
pub diagnostics: bool,
}
Expand description
Server configuration object.
Fields§
§application_name: String
An id for this server
application_uri: String
A description for this server
product_uri: String
Product url
create_sample_keypair: bool
Autocreates public / private keypair if they don’t exist. For testing/samples only since you do not have control of the values
certificate_path: Option<PathBuf>
Path to a custom certificate, to be used instead of the default .der certificate
private_key_path: Option<PathBuf>
Path to a custom private key, to be used instead of the default private key
certificate_validation: CertificateValidation
Checks the certificate’s time validity
pki_dir: PathBuf
PKI folder, either absolute or relative to executable
discovery_server_url: Option<String>
Url to a discovery server - adding this string causes the server to assume you wish to register the server with a discovery server.
tcp_config: TcpConfig
tcp configuration information
limits: Limits
Server OPA UA limits
locale_ids: Vec<String>
Supported locale ids
user_tokens: BTreeMap<String, ServerUserToken>
User tokens
discovery_urls: Vec<String>
discovery endpoint url which may or may not be the same as the service endpoints below.
default_endpoint: Option<String>
Default endpoint id
endpoints: BTreeMap<String, ServerEndpoint>
Endpoints supported by the server
subscription_poll_interval_ms: u64
Interval in milliseconds between each time the subscriptions are polled.
publish_timeout_default_ms: u64
Default publish request timeout.
max_timeout_ms: u32
Max message timeout for non-publish requests. Will not be applied for requests that are handled synchronously. Set to 0 for no timeout, meaning that a timeout will only be applied if the client requests one. If this is greater than zero and the client requests a timeout of 0, this will be used.
max_secure_channel_token_lifetime_ms: u32
Maximum lifetime of secure channel tokens. The client will request a number, this just sets an upper limit on that value. Note that there is no lower limit, if a client sets an expiry of 0, we will just instantly time out.
max_session_timeout_ms: u64
Maximum time before a session will be timed out. The client will request a number, this just sets the upper limit on that value. Note that there is no lower limit, if a client sets an expiry of 0 we will instantly time out.
diagnostics: bool
Enable server diagnostics.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn new<T>(
application_name: T,
user_tokens: BTreeMap<String, ServerUserToken>,
endpoints: BTreeMap<String, ServerEndpoint>,
) -> Self
pub fn new<T>( application_name: T, user_tokens: BTreeMap<String, ServerUserToken>, endpoints: BTreeMap<String, ServerEndpoint>, ) -> Self
Create a new default server config with the given list of user tokens and endpoints.
Sourcepub fn decoding_options(&self) -> DecodingOptions
pub fn decoding_options(&self) -> DecodingOptions
Decoding options given by this config.
Sourcepub fn add_endpoint(&mut self, id: &str, endpoint: ServerEndpoint)
pub fn add_endpoint(&mut self, id: &str, endpoint: ServerEndpoint)
Add an endpoint to the server config.
Sourcepub fn read_x509_thumbprints(&mut self)
pub fn read_x509_thumbprints(&mut self)
Get x509 thumbprints from registered server user tokens.
Sourcepub fn default_endpoint(&self) -> Option<&ServerEndpoint>
pub fn default_endpoint(&self) -> Option<&ServerEndpoint>
Find the default endpoint
Sourcepub fn find_endpoint(
&self,
endpoint_url: &str,
base_endpoint_url: &str,
security_policy: SecurityPolicy,
security_mode: MessageSecurityMode,
) -> Option<&ServerEndpoint>
pub fn find_endpoint( &self, endpoint_url: &str, base_endpoint_url: &str, security_policy: SecurityPolicy, security_mode: MessageSecurityMode, ) -> Option<&ServerEndpoint>
Find the first endpoint that matches the specified url, security policy and message security mode.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more