ServerState

Struct ServerState 

Source
pub struct ServerState {
Show 20 fields pub application_uri: UAString, pub product_uri: UAString, pub application_name: LocalizedText, pub base_endpoint: String, pub start_time: DateTime, pub servers: Vec<String>, pub config: Arc<RwLock<ServerConfig>>, pub server_certificate: Option<X509>, pub server_pkey: Option<PrivateKey>, pub last_subscription_id: u32, pub max_subscriptions: usize, pub max_monitored_items_per_sub: usize, pub max_monitored_item_queue_size: usize, pub min_publishing_interval_ms: Duration, pub min_sampling_interval_ms: Duration, pub default_keep_alive_count: u32, pub max_keep_alive_count: u32, pub max_lifetime_count: u32, pub state: ServerState, pub abort: bool, /* private fields */
}
Expand description

Server state is any state associated with the server as a whole that individual sessions might be interested in. That includes configuration info etc.

Fields§

§application_uri: UAString

The application URI

§product_uri: UAString

The product URI

§application_name: LocalizedText

The application name

§base_endpoint: String

The protocol, hostname and port formatted as a url, but less the path

§start_time: DateTime

The time the server started

§servers: Vec<String>

The list of servers (by urn)

§config: Arc<RwLock<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

§last_subscription_id: u32

The next subscription id - subscriptions are shared across the whole server. Initial value is a random u32.

§max_subscriptions: usize

Maximum number of subscriptions per session, 0 means no limit (danger)

§max_monitored_items_per_sub: usize

Maximum number of monitored items per subscription, 0 means no limit (danger)

§max_monitored_item_queue_size: usize

Maximum number of queued values in a monitored item, 0 means no limit (danger)

§min_publishing_interval_ms: Duration

Minimum publishing interval (in millis)

§min_sampling_interval_ms: Duration

Minimum sampling interval (in millis)

§default_keep_alive_count: u32

Default keep alive count

§max_keep_alive_count: u32

Maxmimum keep alive count

§max_lifetime_count: u32

Maximum lifetime count (3 times as large as max keep alive)

§state: ServerState§abort: bool

Sets the abort flag that terminates the associated server

Implementations§

Source§

impl ServerState

Source

pub fn endpoints( &self, endpoint_url: &UAString, transport_profile_uris: &Option<Vec<UAString>>, ) -> Option<Vec<EndpointDescription>>

Source

pub fn endpoint_exists( &self, endpoint_url: &str, security_policy: SecurityPolicy, security_mode: MessageSecurityMode, ) -> bool

Source

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.

Source

pub fn discovery_urls(&self) -> Option<Vec<UAString>>

Source

pub fn application_type(&self) -> ApplicationType

Source

pub fn gateway_server_uri(&self) -> UAString

Source

pub fn abort(&mut self)

Source

pub fn state(&self) -> ServerStateType

Source

pub fn set_state(&mut self, state: ServerStateType)

Source

pub fn is_abort(&self) -> bool

Source

pub fn is_running(&self) -> bool

Source

pub fn server_certificate_as_byte_string(&self) -> ByteString

Source

pub fn registered_server(&self) -> RegisteredServer

Source

pub fn create_subscription_id(&mut self) -> u32

Source

pub fn authenticate_endpoint( &self, request: &ActivateSessionRequest, endpoint_url: &str, security_policy: SecurityPolicy, security_mode: MessageSecurityMode, user_identity_token: &ExtensionObject, server_nonce: &ByteString, ) -> Result<String, StatusCode>

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.

Source

pub fn set_register_nodes_callbacks( &mut self, register_nodes_callback: Box<dyn RegisterNodes + Send + Sync>, unregister_nodes_callback: Box<dyn UnregisterNodes + Send + Sync>, )

Source

pub fn decoding_options(&self) -> DecodingOptions

Returns the decoding options of the server

Source

pub fn set_historical_data_provider( &mut self, historical_data_provider: Box<dyn HistoricalDataProvider + Send + Sync>, )

Source

pub fn set_historical_event_provider( &mut self, historical_event_provider: Box<dyn HistoricalEventProvider + Send + Sync>, )

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.