pub struct ConnectionManager { /* private fields */ }Expand description
Connection manager for tracking active connections
Implementations§
Source§impl ConnectionManager
impl ConnectionManager
Sourcepub async fn add_connection(&self, connection: Connection) -> u64
pub async fn add_connection(&self, connection: Connection) -> u64
Add a new connection
Sourcepub async fn remove_connection(&self, id: u64) -> Option<ConnectionHandle>
pub async fn remove_connection(&self, id: u64) -> Option<ConnectionHandle>
Remove a connection
Sourcepub async fn get_connection(&self, id: u64) -> Option<ConnectionHandle>
pub async fn get_connection(&self, id: u64) -> Option<ConnectionHandle>
Get a 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 the number of active connections
Trait Implementations§
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