- add: get_connection_mut function to allow modifying the connection state

This commit is contained in:
2024-12-20 17:44:22 -05:00
parent e3fb186a44
commit e0114fd832

View File

@@ -24,6 +24,10 @@ impl ConnectionService {
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) {
self.connections.remove(connection_id);
}