Struct actix_jwt_session::SessionStorage
source · pub struct SessionStorage<ClaimsType: Claims> { /* private fields */ }Expand description
Allow to save, read and remove session from storage.
Implementations§
source§impl<ClaimsType: Claims> SessionStorage<ClaimsType>
impl<ClaimsType: Claims> SessionStorage<ClaimsType>
pub async fn set_by_jti( &self, claims: ClaimsType, exp: Duration ) -> Result<(), Error>
sourcepub async fn get_from_jti(&self, jti: Uuid) -> Result<ClaimsType, Error>
pub async fn get_from_jti(&self, jti: Uuid) -> Result<ClaimsType, Error>
Load claims from storage or returns Error if record does not exists or there was other error while trying to fetch data from storage.
sourcepub async fn store(
&self,
claims: ClaimsType,
exp: Duration
) -> Result<Authenticated<ClaimsType>, Error>
pub async fn store( &self, claims: ClaimsType, exp: Duration ) -> Result<Authenticated<ClaimsType>, Error>
Save claims in storage in a way claims can be loaded from database using jti as uuid::Uuid (JWT ID)
Trait Implementations§
Auto Trait Implementations§
impl<ClaimsType> !RefUnwindSafe for SessionStorage<ClaimsType>
impl<ClaimsType> Send for SessionStorage<ClaimsType>
impl<ClaimsType> Sync for SessionStorage<ClaimsType>
impl<ClaimsType> Unpin for SessionStorage<ClaimsType>
impl<ClaimsType> !UnwindSafe for SessionStorage<ClaimsType>
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