pub struct SessionManager { /* private fields */ }Implementations§
Source§impl SessionManager
impl SessionManager
pub fn new(config: SessionConfig) -> Self
pub async fn create_session( &self, user_id: Uuid, access_token: String, refresh_token: String, access_token_ttl: Duration, refresh_token_ttl: Duration, device_id: Option<String>, ip_address: Option<IpAddr>, user_agent: Option<String>, scopes: Vec<String>, ) -> Result<Session>
pub async fn get_session(&self, session_id: &Uuid) -> Result<Session>
pub async fn validate_session( &self, session_id: &Uuid, ip_address: Option<IpAddr>, device_id: Option<&str>, ) -> Result<Session>
pub async fn update_activity(&self, session_id: &Uuid) -> Result<()>
pub async fn refresh_session( &self, session_id: &Uuid, new_access_token: String, access_token_ttl: Duration, ) -> Result<Session>
pub async fn delete_session(&self, session_id: &Uuid) -> Result<()>
pub async fn delete_user_sessions(&self, user_id: &Uuid) -> Result<usize>
pub async fn list_user_sessions(&self, user_id: &Uuid) -> Vec<Session>
pub async fn cleanup_expired_sessions(&self) -> Result<usize>
pub async fn get_stats(&self) -> SessionStats
Auto Trait Implementations§
impl Freeze for SessionManager
impl !RefUnwindSafe for SessionManager
impl Send for SessionManager
impl Sync for SessionManager
impl Unpin for SessionManager
impl !UnwindSafe for SessionManager
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