pub struct ClientRegistry { /* private fields */ }Expand description
Global registry for all client connections
Implementations§
Source§impl ClientRegistry
impl ClientRegistry
pub fn new() -> Self
Sourcepub fn register(&self, conn: &Connection, thread_id: usize)
pub fn register(&self, conn: &Connection, thread_id: usize)
Register a new client connection
Sourcepub fn update(&self, conn: &Connection)
pub fn update(&self, conn: &Connection)
Update client info
Sourcepub fn unregister(&self, connection_id: usize)
pub fn unregister(&self, connection_id: usize)
Unregister a client connection
Sourcepub fn get_all_clients(&self) -> Vec<ClientInfo>
pub fn get_all_clients(&self) -> Vec<ClientInfo>
Get all client information
Sourcepub fn get_client(&self, connection_id: usize) -> Option<ClientInfo>
pub fn get_client(&self, connection_id: usize) -> Option<ClientInfo>
Get client by ID
Sourcepub fn kill_clients(
&self,
filter_id: Option<usize>,
filter_addr: Option<&str>,
filter_type: Option<&str>,
) -> Vec<usize>
pub fn kill_clients( &self, filter_id: Option<usize>, filter_addr: Option<&str>, filter_type: Option<&str>, ) -> Vec<usize>
Kill clients matching criteria
Sourcepub fn client_count(&self) -> usize
pub fn client_count(&self) -> usize
Count total clients
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientRegistry
impl !RefUnwindSafe for ClientRegistry
impl Send for ClientRegistry
impl Sync for ClientRegistry
impl Unpin for ClientRegistry
impl !UnwindSafe for ClientRegistry
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