pub struct SessionStore<'a> { /* private fields */ }Expand description
Session store that uses configured secondary storage when present.
Implementations§
Source§impl<'a> SessionStore<'a>
impl<'a> SessionStore<'a>
pub fn new(context: &'a AuthContext) -> Result<Self, RustAuthError>
pub fn with_storage( adapter: &'a dyn DbAdapter, secondary_storage: Option<Arc<dyn SecondaryStorage>>, store_session_in_database: bool, preserve_session_in_database: bool, ) -> Self
pub fn with_storage_and_schema( adapter: &'a dyn DbAdapter, schema: DbSchema, secondary_storage: Option<Arc<dyn SecondaryStorage>>, store_session_in_database: bool, preserve_session_in_database: bool, ) -> Self
pub async fn create_session( &self, input: CreateSessionInput, ) -> Result<Session, RustAuthError>
pub async fn find_session( &self, token: &str, ) -> Result<Option<Session>, RustAuthError>
pub async fn find_session_including_expired( &self, token: &str, ) -> Result<Option<Session>, RustAuthError>
pub async fn find_sessions<I, S>( &self, tokens: I, ) -> Result<Vec<Session>, RustAuthError>
pub async fn update_session_expiry( &self, token: &str, expires_at: OffsetDateTime, ) -> Result<Option<Session>, RustAuthError>
pub async fn delete_session(&self, token: &str) -> Result<(), RustAuthError>
pub async fn delete_user_sessions( &self, user_id: &str, ) -> Result<u64, RustAuthError>
pub async fn refresh_user_sessions( &self, user_id: &str, ) -> Result<u64, RustAuthError>
pub async fn list_user_sessions( &self, user_id: &str, ) -> Result<Vec<Session>, RustAuthError>
Trait Implementations§
Source§impl<'a> Clone for SessionStore<'a>
impl<'a> Clone for SessionStore<'a>
Source§fn clone(&self) -> SessionStore<'a>
fn clone(&self) -> SessionStore<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> !RefUnwindSafe for SessionStore<'a>
impl<'a> !UnwindSafe for SessionStore<'a>
impl<'a> Freeze for SessionStore<'a>
impl<'a> Send for SessionStore<'a>
impl<'a> Sync for SessionStore<'a>
impl<'a> Unpin for SessionStore<'a>
impl<'a> UnsafeUnpin for SessionStore<'a>
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