pub struct SessionManager { /* private fields */ }Expand description
Session manager for connection pooling and lifecycle management.
Implementations§
Source§impl SessionManager
impl SessionManager
Sourcepub fn new(
auth_handler: Arc<AuthenticationHandler>,
config: SessionConfig,
) -> Self
pub fn new( auth_handler: Arc<AuthenticationHandler>, config: SessionConfig, ) -> Self
Create a new session manager.
Sourcepub async fn register_session(&self, session: Arc<Session>)
pub async fn register_session(&self, session: Arc<Session>)
Register a new session.
Sourcepub async fn active_sessions(&self) -> Vec<Arc<Session>>
pub async fn active_sessions(&self) -> Vec<Arc<Session>>
Get all active sessions.
Sourcepub async fn close_all(&self) -> Result<(), ConnectionError>
pub async fn close_all(&self) -> Result<(), ConnectionError>
Close all sessions.
Sourcepub async fn cleanup_idle_sessions(&self) -> usize
pub async fn cleanup_idle_sessions(&self) -> usize
Clean up idle sessions beyond timeout.
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