pub struct SessionMiddlewareBuilder<ClaimsType: Claims> { /* private fields */ }
Expand description
Session middleware factory builder
It should be constructed with SessionMiddlewareFactory::build.
Implementations§
source§impl<ClaimsType: Claims> SessionMiddlewareBuilder<ClaimsType>
impl<ClaimsType: Claims> SessionMiddlewareBuilder<ClaimsType>
sourcepub fn with_storage(self, storage: SessionStorage) -> Self
pub fn with_storage(self, storage: SessionStorage) -> Self
Set session storage to given instance. Good if for some reason you need to share 1 storage with multiple instances of session middleware
Add cookie extractor for refresh token.
sourcepub fn with_refresh_header(self, name: &'static str) -> Self
pub fn with_refresh_header(self, name: &'static str) -> Self
Add header extractor for refresh token.
Add cookie extractor for json web token.
sourcepub fn with_jwt_header(self, name: &'static str) -> Self
pub fn with_jwt_header(self, name: &'static str) -> Self
Add header extractor for json web token.
sourcepub fn with_jwt_json(self, path: &'static [&'static str]) -> Self
pub fn with_jwt_json(self, path: &'static [&'static str]) -> Self
Add JSON extractor for json web token.
sourcepub fn finish(self) -> (SessionStorage, SessionMiddlewareFactory<ClaimsType>)
pub fn finish(self) -> (SessionStorage, SessionMiddlewareFactory<ClaimsType>)
Builds middleware factory and returns session storage with factory
source§impl<ClaimsType: Claims> SessionMiddlewareBuilder<ClaimsType>
impl<ClaimsType: Claims> SessionMiddlewareBuilder<ClaimsType>
pub fn with_redis_pool(self, pool: Pool) -> Self
Auto Trait Implementations§
impl<ClaimsType> !RefUnwindSafe for SessionMiddlewareBuilder<ClaimsType>
impl<ClaimsType> Send for SessionMiddlewareBuilder<ClaimsType>
impl<ClaimsType> Sync for SessionMiddlewareBuilder<ClaimsType>
impl<ClaimsType> Unpin for SessionMiddlewareBuilder<ClaimsType>
impl<ClaimsType> !UnwindSafe for SessionMiddlewareBuilder<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