pub struct SessionManager<R: SessionRepository> { /* private fields */ }Implementations§
Source§impl<R: SessionRepository> SessionManager<R>
impl<R: SessionRepository> SessionManager<R>
pub fn new(repository: Arc<R>, config: SessionConfig) -> Self
pub async fn create_session( &self, user_id: Uuid, ip_address: Option<String>, user_agent: Option<String>, ) -> Result<(Session, String)>
pub async fn validate_session(&self, token: &str) -> Result<Session>
pub async fn invalidate_session(&self, session_id: Uuid) -> Result<()>
pub async fn invalidate_all_sessions(&self, user_id: Uuid) -> Result<()>
pub async fn get_user_sessions(&self, user_id: Uuid) -> Result<Vec<Session>>
pub async fn cleanup_expired(&self) -> Result<u64>
Auto Trait Implementations§
impl<R> Freeze for SessionManager<R>
impl<R> RefUnwindSafe for SessionManager<R>where
R: RefUnwindSafe,
impl<R> Send for SessionManager<R>
impl<R> Sync for SessionManager<R>
impl<R> Unpin for SessionManager<R>
impl<R> UnsafeUnpin for SessionManager<R>
impl<R> UnwindSafe for SessionManager<R>where
R: RefUnwindSafe,
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