From e0114fd83277ae97245ebb43a19d64576b6b259734bcd04d1b7209130ba1769c Mon Sep 17 00:00:00 2001 From: raven <7156279+RavenX8@users.noreply.github.com> Date: Fri, 20 Dec 2024 17:44:22 -0500 Subject: [PATCH] - add: get_connection_mut function to allow modifying the connection state --- packet-service/src/connection_service.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packet-service/src/connection_service.rs b/packet-service/src/connection_service.rs index cafa5f9..e5c2704 100644 --- a/packet-service/src/connection_service.rs +++ b/packet-service/src/connection_service.rs @@ -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> { + self.connections.get_mut(connection_id) + } + pub fn remove_connection(&self, connection_id: &str) { self.connections.remove(connection_id); }