pub struct ServerHandle { /* private fields */ }
Expand description
Reference to a server instance containing tools to modify the server while it is running.
Implementations§
Source§impl ServerHandle
impl ServerHandle
Sourcepub fn info(&self) -> &Arc<ServerInfo>
pub fn info(&self) -> &Arc<ServerInfo>
Get a reference to the ServerInfo, containing configuration and other shared server data.
Sourcepub fn subscriptions(&self) -> &Arc<SubscriptionCache>
pub fn subscriptions(&self) -> &Arc<SubscriptionCache>
Get a reference to the subscription cache.
Sourcepub fn set_service_level(&self, sl: u8)
pub fn set_service_level(&self, sl: u8)
Set the service level, properly notifying subscribed clients of the change.
Sourcepub fn node_managers(&self) -> &NodeManagers
pub fn node_managers(&self) -> &NodeManagers
Get a reference to the node managers on the server.
Sourcepub fn session_manager(&self) -> &RwLock<SessionManager>
pub fn session_manager(&self) -> &RwLock<SessionManager>
Get a reference to the session manager, containing all currently active sessions.
Sourcepub fn type_tree(&self) -> &RwLock<DefaultTypeTree>
pub fn type_tree(&self) -> &RwLock<DefaultTypeTree>
Get a reference to the type tree, containing shared information about types in the server.
Sourcepub fn set_server_state(&self, state: ServerState)
pub fn set_server_state(&self, state: ServerState)
Set the server state. Note that this does not do anything beyond just setting the state and notifying clients.
Sourcepub fn token(&self) -> &CancellationToken
pub fn token(&self) -> &CancellationToken
Get the cancellation token.
Sourcepub fn get_namespace_index(&self, namespace: &str) -> Option<u16>
pub fn get_namespace_index(&self, namespace: &str) -> Option<u16>
Shorthand for getting the index of a namespace defined in the global server type tree.
Sourcepub fn shutdown_after(&self, time: Duration, reason: impl Into<LocalizedText>)
pub fn shutdown_after(&self, time: Duration, reason: impl Into<LocalizedText>)
Tell the server to stop after time
has elapsed. This will
update the SecondsTillShutdown
variable on the server as needed.
Trait Implementations§
Source§impl Clone for ServerHandle
impl Clone for ServerHandle
Source§fn clone(&self) -> ServerHandle
fn clone(&self) -> ServerHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more