pub struct Session<P> { /* private fields */ }Expand description
Server-side authenticated session value.
Implementations§
Source§impl<P> Session<P>
impl<P> Session<P>
Sourcepub fn new(
id: SessionId,
principal: P,
created_at: SystemTime,
expires_at: SystemTime,
) -> SoapResult<Self>
pub fn new( id: SessionId, principal: P, created_at: SystemTime, expires_at: SystemTime, ) -> SoapResult<Self>
Creates a session with a strictly later expiration time.
Sourcepub fn is_expired_at(&self, now: SystemTime) -> bool
pub fn is_expired_at(&self, now: SystemTime) -> bool
Reports expiration against an externally supplied time.
Sourcepub const fn created_at(&self) -> SystemTime
pub const fn created_at(&self) -> SystemTime
Returns the externally supplied creation time.
Sourcepub const fn expires_at(&self) -> SystemTime
pub const fn expires_at(&self) -> SystemTime
Returns the absolute expiration time.
Sourcepub fn into_principal(self) -> P
pub fn into_principal(self) -> P
Consumes the session into its principal.
Trait Implementations§
impl<P: Eq> Eq for Session<P>
impl<P: PartialEq> StructuralPartialEq for Session<P>
Auto Trait Implementations§
impl<P> Freeze for Session<P>where
P: Freeze,
impl<P> RefUnwindSafe for Session<P>where
P: RefUnwindSafe,
impl<P> Send for Session<P>where
P: Send,
impl<P> Sync for Session<P>where
P: Sync,
impl<P> Unpin for Session<P>where
P: Unpin,
impl<P> UnsafeUnpin for Session<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for Session<P>where
P: UnwindSafe,
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