Struct opcua_server::config::ServerConfig
source · [−]pub struct ServerConfig {Show 17 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 performance: Performance,
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>,
}
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
performance: Performance
Server Performance
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
Implementations
sourceimpl ServerConfig
impl ServerConfig
pub fn new<T>(
application_name: T,
user_tokens: BTreeMap<String, ServerUserToken>,
endpoints: BTreeMap<String, ServerEndpoint>
) -> Self where
T: Into<String>,
pub fn decoding_options(&self) -> DecodingOptions
pub fn add_endpoint(&mut self, id: &str, endpoint: ServerEndpoint)
pub fn read_x509_thumbprints(&mut self)
sourcepub fn base_endpoint_url(&self) -> String
pub fn base_endpoint_url(&self) -> String
Returns a opc.tcp://server:port url that paths can be appended onto
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,
security_policy: SecurityPolicy,
security_mode: MessageSecurityMode
) -> Option<&ServerEndpoint>
pub fn find_endpoint(
&self,
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
sourceimpl Clone for ServerConfig
impl Clone for ServerConfig
sourcefn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Config for ServerConfig
impl Config for ServerConfig
fn is_valid(&self) -> bool
fn application_name(&self) -> UAString
fn application_uri(&self) -> UAString
fn product_uri(&self) -> UAString
fn application_type(&self) -> ApplicationType
fn discovery_urls(&self) -> Option<Vec<UAString>>
fn save(&self, path: &Path) -> Result<(), ()>
fn load<A>(path: &Path) -> Result<A, ()> where
A: Config + for<'de> Deserialize<'de>,
fn application_description(&self) -> ApplicationDescription
sourceimpl Debug for ServerConfig
impl Debug for ServerConfig
sourceimpl Default for ServerConfig
impl Default for ServerConfig
sourceimpl<'de> Deserialize<'de> for ServerConfig
impl<'de> Deserialize<'de> for ServerConfig
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<ServerConfig> for Server
impl From<ServerConfig> for Server
sourcefn from(config: ServerConfig) -> Server
fn from(config: ServerConfig) -> Server
Converts to this type from the input type.
sourceimpl PartialEq<ServerConfig> for ServerConfig
impl PartialEq<ServerConfig> for ServerConfig
sourcefn eq(&self, other: &ServerConfig) -> bool
fn eq(&self, other: &ServerConfig) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ServerConfig) -> bool
fn ne(&self, other: &ServerConfig) -> bool
This method tests for !=
.
sourceimpl Serialize for ServerConfig
impl Serialize for ServerConfig
impl StructuralPartialEq for ServerConfig
Auto Trait Implementations
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more