pub struct Session { /* private fields */ }Expand description
Session state shared between the read loop and every dispatch task
(SRV-010): the auth flag is a lock-free atomic flipped by HELLO/AUTH
and read by the dispatch path without locks.
Implementations§
Source§impl Session
impl Session
Sourcepub fn connection_id(&self) -> u64
pub fn connection_id(&self) -> u64
Listener-scoped connection id, surfaced in the metadata-shape HELLO reply (SRV-014).
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Lock-free read of the auth flag (SRV-010).
Sourcepub fn principal(&self) -> Option<Principal>
pub fn principal(&self) -> Option<Principal>
The principal resolved by the last successful HELLO/AUTH.
Sourcepub fn push_sender(&self) -> Option<&PushSender>
pub fn push_sender(&self) -> Option<&PushSender>
Typed push channel for this connection (SRV-013). Some only under
push = Enabled profiles; under Reserved no push emission is
possible.
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