pub struct SessionRegistry { /* private fields */ }Expand description
Thread-safe map of live sessions.
Implementations§
Source§impl SessionRegistry
impl SessionRegistry
pub async fn insert(&self, id: SessionId, session: Arc<DedicatedSession>)
pub async fn get(&self, id: &str) -> Option<Arc<DedicatedSession>>
pub async fn remove(&self, id: &str) -> Option<Arc<DedicatedSession>>
pub async fn len(&self) -> usize
pub async fn is_empty(&self) -> bool
Sourcepub async fn drain(&self) -> Vec<Arc<DedicatedSession>>
pub async fn drain(&self) -> Vec<Arc<DedicatedSession>>
Drain every session. Used on shutdown.
Trait Implementations§
Source§impl Debug for SessionRegistry
impl Debug for SessionRegistry
Source§impl Default for SessionRegistry
impl Default for SessionRegistry
Source§fn default() -> SessionRegistry
fn default() -> SessionRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for SessionRegistry
impl !RefUnwindSafe for SessionRegistry
impl Send for SessionRegistry
impl Sync for SessionRegistry
impl Unpin for SessionRegistry
impl UnsafeUnpin for SessionRegistry
impl !UnwindSafe for SessionRegistry
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