pub struct ServerInfo {Show 22 fields
pub application_uri: UAString,
pub product_uri: UAString,
pub application_name: LocalizedText,
pub start_time: ArcSwap<DateTime>,
pub servers: Vec<String>,
pub config: Arc<ServerConfig>,
pub server_certificate: Option<X509>,
pub server_pkey: Option<PrivateKey>,
pub state: ArcSwap<ServerState>,
pub send_buffer_size: usize,
pub receive_buffer_size: usize,
pub authenticator: Arc<dyn AuthManager>,
pub type_tree: Arc<RwLock<DefaultTypeTree>>,
pub type_tree_getter: Arc<dyn TypeTreeForUser>,
pub subscription_id_handle: AtomicHandle,
pub monitored_item_id_handle: AtomicHandle,
pub secure_channel_id_handle: Arc<AtomicHandle>,
pub capabilities: ServerCapabilities,
pub service_level: Arc<AtomicU8>,
pub port: AtomicU16,
pub type_loaders: RwLock<TypeLoaderCollection>,
pub diagnostics: ServerDiagnostics,
/* private fields */
}Expand description
Server state is any configuration associated with the server as a whole that individual sessions might be interested in.
Fields§
§application_uri: UAStringThe application URI
product_uri: UAStringThe product URI
application_name: LocalizedTextThe application name
start_time: ArcSwap<DateTime>The time the server started
servers: Vec<String>The list of servers (by urn)
config: Arc<ServerConfig>Server configuration
server_certificate: Option<X509>Server public certificate read from config location or null if there is none
server_pkey: Option<PrivateKey>Server private key
state: ArcSwap<ServerState>Current state
send_buffer_size: usizeAudit log Diagnostic information Size of the send buffer in bytes
receive_buffer_size: usizeSize of the receive buffer in bytes
authenticator: Arc<dyn AuthManager>Authenticator to use when verifying user identities, and checking for user access.
type_tree: Arc<RwLock<DefaultTypeTree>>Structure containing type metadata shared by the entire server.
type_tree_getter: Arc<dyn TypeTreeForUser>Wrapper to get a type tree for a specific user.
subscription_id_handle: AtomicHandleGenerator for subscription IDs.
monitored_item_id_handle: AtomicHandleGenerator for monitored item IDs.
secure_channel_id_handle: Arc<AtomicHandle>Generator for secure channel IDs.
capabilities: ServerCapabilitiesServer capabilities
service_level: Arc<AtomicU8>Service level observer.
port: AtomicU16Currently active local port.
type_loaders: RwLock<TypeLoaderCollection>List of active type loaders
diagnostics: ServerDiagnosticsCurrent server diagnostics.
Implementations§
Source§impl ServerInfo
impl ServerInfo
Sourcepub fn endpoints(
&self,
endpoint_url: &UAString,
transport_profile_uris: &Option<Vec<UAString>>,
) -> Option<Vec<EndpointDescription>>
pub fn endpoints( &self, endpoint_url: &UAString, transport_profile_uris: &Option<Vec<UAString>>, ) -> Option<Vec<EndpointDescription>>
Get the list of endpoints that match the provided filters.
Sourcepub fn endpoint_exists(
&self,
endpoint_url: &str,
security_policy: SecurityPolicy,
security_mode: MessageSecurityMode,
) -> bool
pub fn endpoint_exists( &self, endpoint_url: &str, security_policy: SecurityPolicy, security_mode: MessageSecurityMode, ) -> bool
Check if the endpoint given by endpoint_url, security_policy, and security_mode
exists on the server.
Sourcepub fn new_endpoint_descriptions(
&self,
endpoint_url: &str,
) -> Option<Vec<EndpointDescription>>
pub fn new_endpoint_descriptions( &self, endpoint_url: &str, ) -> Option<Vec<EndpointDescription>>
Make matching endpoint descriptions for the specified url. If none match then None will be passed, therefore if Some is returned it will be guaranteed to contain at least one result.
Sourcepub fn discovery_urls(&self) -> Option<Vec<UAString>>
pub fn discovery_urls(&self) -> Option<Vec<UAString>>
Get the list of discovery URLs on the server.
Sourcepub fn application_type(&self) -> ApplicationType
pub fn application_type(&self) -> ApplicationType
Get the application type, will be Server.
Sourcepub fn gateway_server_uri(&self) -> UAString
pub fn gateway_server_uri(&self) -> UAString
Get the gateway server URI.
Sourcepub fn state(&self) -> ServerStateType
pub fn state(&self) -> ServerStateType
Get the current server state.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the server state indicates the server is running.
Sourcepub fn base_endpoint(&self) -> String
pub fn base_endpoint(&self) -> String
Get the base endpoint, i.e. the configured host + current port.
Sourcepub fn server_certificate_as_byte_string(&self) -> ByteString
pub fn server_certificate_as_byte_string(&self) -> ByteString
Get the server certificate as a byte string.
Sourcepub fn registered_server(&self) -> RegisteredServer
pub fn registered_server(&self) -> RegisteredServer
Get a representation of this server as a RegisteredServer object.
Sourcepub async fn authenticate_endpoint(
&self,
request: &ActivateSessionRequest,
endpoint_url: &str,
security_policy: SecurityPolicy,
security_mode: MessageSecurityMode,
user_identity_token: ExtensionObject,
server_nonce: &ByteString,
) -> Result<UserToken, Error>
pub async fn authenticate_endpoint( &self, request: &ActivateSessionRequest, endpoint_url: &str, security_policy: SecurityPolicy, security_mode: MessageSecurityMode, user_identity_token: ExtensionObject, server_nonce: &ByteString, ) -> Result<UserToken, Error>
Authenticates access to an endpoint. The endpoint is described by its path, policy, mode and the token is supplied in an extension object that must be extracted and authenticated.
It is possible that the endpoint does not exist, or that the token is invalid / unsupported or that the token cannot be used with the end point. The return codes reflect the responses that ActivateSession would expect from a service call.
Sourcepub fn decoding_options(&self) -> DecodingOptions
pub fn decoding_options(&self) -> DecodingOptions
Returns the decoding options of the server
Sourcepub fn add_type_loader(&self, type_loader: Arc<dyn TypeLoader>)
pub fn add_type_loader(&self, type_loader: Arc<dyn TypeLoader>)
Add a type loader to the server. Note that there is no mechanism to ensure uniqueness, you should avoid adding the same type loader more than once, it will work, but there will be a small performance overhead.
Sourcepub fn summary(&self) -> &ServerDiagnosticsSummary
pub fn summary(&self) -> &ServerDiagnosticsSummary
Convenience method to get the diagnostics summary.