pub struct SessionManager { /* private fields */ }Expand description
Manages active sessions.
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn create_session(&self, peer_addr: SocketAddr) -> u64
pub fn create_session(&self, peer_addr: SocketAddr) -> u64
Creates a new session and returns its ID.
Sourcepub fn close_session(&self, session_id: u64) -> Option<Session>
pub fn close_session(&self, session_id: u64) -> Option<Session>
Closes a session.
Sourcepub fn get_session(&self, session_id: u64) -> Option<Session>
pub fn get_session(&self, session_id: u64) -> Option<Session>
Gets a session by ID.
Sourcepub fn touch_session(&self, session_id: u64)
pub fn touch_session(&self, session_id: u64)
Updates the last activity timestamp for a session.
Sourcepub fn session_ids(&self) -> Vec<u64>
pub fn session_ids(&self) -> Vec<u64>
Returns all session IDs.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SessionManager
impl !RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl UnsafeUnpin for SessionManager
impl UnwindSafe for SessionManager
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