pub struct ConnectionManager { /* private fields */ }Expand description
Connection manager
Implementations§
Source§impl ConnectionManager
impl ConnectionManager
Sourcepub fn new(config: ServerConfig) -> Self
pub fn new(config: ServerConfig) -> Self
Create a new connection manager
Sourcepub fn set_cleanup_interval(&mut self, interval: Duration)
pub fn set_cleanup_interval(&mut self, interval: Duration)
Set the cleanup interval
Sourcepub async fn add_connection(
&self,
connection: Connection,
) -> Result<ConnectionHandle>
pub async fn add_connection( &self, connection: Connection, ) -> Result<ConnectionHandle>
Add a new connection
Sourcepub async fn remove_connection(&self, id: u64, reason: CloseReason)
pub async fn remove_connection(&self, id: u64, reason: CloseReason)
Remove a connection
Sourcepub async fn get_connection(&self, id: u64) -> Option<ConnectionHandle>
pub async fn get_connection(&self, id: u64) -> Option<ConnectionHandle>
Get connection by ID
Sourcepub async fn get_all_connections(&self) -> Vec<ConnectionHandle>
pub async fn get_all_connections(&self) -> Vec<ConnectionHandle>
Get all active connections
Sourcepub async fn connection_count(&self) -> usize
pub async fn connection_count(&self) -> usize
Get current connection count
Sourcepub async fn get_stats(&self) -> ManagerStats
pub async fn get_stats(&self) -> ManagerStats
Get connection manager statistics
Sourcepub async fn start_cleanup_task(&self)
pub async fn start_cleanup_task(&self)
Start the cleanup task
Sourcepub async fn monitor_connections(&self) -> Result<Vec<ConnectionHealth>>
pub async fn monitor_connections(&self) -> Result<Vec<ConnectionHealth>>
Monitor connection health
Sourcepub async fn close_all_connections(&self)
pub async fn close_all_connections(&self)
Close all connections
Trait Implementations§
Source§impl Debug for ConnectionManager
impl Debug for ConnectionManager
Auto Trait Implementations§
impl Freeze for ConnectionManager
impl !RefUnwindSafe for ConnectionManager
impl Send for ConnectionManager
impl Sync for ConnectionManager
impl Unpin for ConnectionManager
impl !UnwindSafe for ConnectionManager
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