pub struct ServerHandle<A = SocketAddr>(/* private fields */);
Implementations§
Source§impl<A> ServerHandle<A>
impl<A> ServerHandle<A>
Sourcepub fn local_addr(&self) -> &A
pub fn local_addr(&self) -> &A
Returns the local address of the server
Sourcepub fn trigger_shutdown(&self)
pub fn trigger_shutdown(&self)
Trigger a graceful shutdown of the server, but don’t wait till the server has completed shutting down
Sourcepub async fn wait_for_shutdown(&self)
pub async fn wait_for_shutdown(&self)
Completes once the network has been shutdown.
This explicitly does not trigger the network to shutdown, see trigger_shutdown
or
shutdown
if you want to trigger shutting down the server.
Sourcepub async fn shutdown(&self)
pub async fn shutdown(&self)
Triggers a shutdown of the server and waits for it to complete shutting down.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Checks if the Server has been shutdown.
pub fn connections( &self, ) -> RwLockReadGuard<'_, HashMap<ConnectionId, ConnectionInfo<A>>>
Sourcepub fn number_of_connections(&self) -> usize
pub fn number_of_connections(&self) -> usize
Returns the number of active connections the server is handling
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for ServerHandle<A>
impl<A = SocketAddr> !RefUnwindSafe for ServerHandle<A>
impl<A> Send for ServerHandle<A>
impl<A> Sync for ServerHandle<A>
impl<A> Unpin for ServerHandle<A>
impl<A = SocketAddr> !UnwindSafe for ServerHandle<A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more