- add: get_connection_mut function to allow modifying the connection state
This commit is contained in:
@@ -24,6 +24,10 @@ impl ConnectionService {
|
|||||||
self.connections.get(connection_id).map(|entry| entry.clone())
|
self.connections.get(connection_id).map(|entry| entry.clone())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_connection_mut(&self, connection_id: &str) -> Option<dashmap::mapref::one::RefMut<'_, String, ConnectionState>> {
|
||||||
|
self.connections.get_mut(connection_id)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn remove_connection(&self, connection_id: &str) {
|
pub fn remove_connection(&self, connection_id: &str) {
|
||||||
self.connections.remove(connection_id);
|
self.connections.remove(connection_id);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user