pub struct Session { /* private fields */ }Expand description
Authenticated session behind refresh and revocation flows.
Implementations§
Source§impl Session
impl Session
pub fn new( id: SessionId, user_id: UserId, tenant_id: TenantId, issued_at: SystemTime, expires_at: SystemTime, ) -> NythosResult<Self>
pub fn with_ttl( id: SessionId, user_id: UserId, tenant_id: TenantId, issued_at: SystemTime, ttl: Duration, ) -> NythosResult<Self>
pub const fn id(&self) -> SessionId
pub const fn user_id(&self) -> UserId
pub const fn tenant_id(&self) -> TenantId
pub const fn issued_at(&self) -> SystemTime
pub const fn expires_at(&self) -> SystemTime
pub const fn is_revoked(&self) -> bool
pub fn revoke(&mut self)
pub fn is_expired_at(&self, now: SystemTime) -> bool
pub fn is_active_at(&self, now: SystemTime) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Session
impl<'de> Deserialize<'de> for Session
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Session
impl StructuralPartialEq for Session
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