pub struct Session<UserId> { /* private fields */ }Implementations§
Source§impl<UserId> Session<UserId>
impl<UserId> Session<UserId>
pub fn new( id: SessionId, user_id: UserId, created_at_unix: u64, expires_at_unix: u64, ) -> Self
pub fn with_auth_hash(self, auth_hash: impl Into<String>) -> Self
pub fn id(&self) -> &SessionId
pub fn user_id(&self) -> &UserId
pub fn created_at_unix(&self) -> u64
pub fn expires_at_unix(&self) -> u64
pub fn auth_hash(&self) -> Option<&str>
pub fn is_expired_at(&self, unix_timestamp: u64) -> bool
Trait Implementations§
impl<UserId: Eq> Eq for Session<UserId>
impl<UserId: PartialEq> StructuralPartialEq for Session<UserId>
Auto Trait Implementations§
impl<UserId> Freeze for Session<UserId>where
UserId: Freeze,
impl<UserId> RefUnwindSafe for Session<UserId>where
UserId: RefUnwindSafe,
impl<UserId> Send for Session<UserId>where
UserId: Send,
impl<UserId> Sync for Session<UserId>where
UserId: Sync,
impl<UserId> Unpin for Session<UserId>where
UserId: Unpin,
impl<UserId> UnsafeUnpin for Session<UserId>where
UserId: UnsafeUnpin,
impl<UserId> UnwindSafe for Session<UserId>where
UserId: 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