pub struct Session { /* private fields */ }Expand description
Per-connection stats context, created via Handle::session.
Cheap to clone (an Arc inside): one context is shared by both origin handles
of a session (its publish and subscribe halves) so presence and viewer counts
are never double-attributed. It carries three things:
- the tier + auth root, so any broadcast reached through a tagged origin handle
resolves the right per-
(path, tier)counters, - the presence gauge:
sessionsbumps when the context is created andsessions_closedwhen the last clone drops (a more honest close than a separately-held guard), - the egress viewer refcount map (first/last active subscription per broadcast),
driving
broadcasts/broadcasts_closed.
Session::default is the no-op context (disabled registry / untagged caller):
every bump reached through it is silently dropped, so a handle can hold one
unconditionally instead of threading an Option.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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