pub struct DbSessionStore<'a> { /* private fields */ }Expand description
Session store backed by the RustAuth adapter contract.
Implementations§
Source§impl<'a> DbSessionStore<'a>
impl<'a> DbSessionStore<'a>
pub fn new(adapter: &'a dyn DbAdapter) -> Self
pub fn with_schema(adapter: &'a dyn DbAdapter, schema: DbSchema) -> Self
pub fn from_context(context: &'a AuthContext) -> Result<Self, RustAuthError>
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 DbSessionStore<'a>
impl<'a> Clone for DbSessionStore<'a>
Source§fn clone(&self) -> DbSessionStore<'a>
fn clone(&self) -> DbSessionStore<'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 DbSessionStore<'a>
impl<'a> !UnwindSafe for DbSessionStore<'a>
impl<'a> Freeze for DbSessionStore<'a>
impl<'a> Send for DbSessionStore<'a>
impl<'a> Sync for DbSessionStore<'a>
impl<'a> Unpin for DbSessionStore<'a>
impl<'a> UnsafeUnpin for DbSessionStore<'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