pub struct SessionMiddleware { /* private fields */ }Expand description
Loads and persists server-side sessions through a secure ID cookie.
SessionMiddleware::new preserves the single-process SessionStore path. Use
SessionMiddleware::distributed with a shared atomic SessionBackend when multiple
application instances must observe and update the same sessions.
Implementations§
Source§impl SessionMiddleware
impl SessionMiddleware
pub fn new(store: SessionStore, config: SessionConfig) -> Self
Sourcepub fn distributed(
backend: Arc<dyn SessionBackend>,
config: SessionConfig,
) -> Self
pub fn distributed( backend: Arc<dyn SessionBackend>, config: SessionConfig, ) -> Self
Use a shared backend with atomic compare-and-swap session mutations.
Sourcepub fn with_backend(
config: SessionConfig,
backend: Arc<dyn SessionBackend>,
) -> Self
pub fn with_backend( config: SessionConfig, backend: Arc<dyn SessionBackend>, ) -> Self
Alias for SessionMiddleware::distributed following the other backend middleware APIs.
Trait Implementations§
Source§impl Clone for SessionMiddleware
impl Clone for SessionMiddleware
Source§impl Debug for SessionMiddleware
impl Debug for SessionMiddleware
Auto Trait Implementations§
impl !RefUnwindSafe for SessionMiddleware
impl !UnwindSafe for SessionMiddleware
impl Freeze for SessionMiddleware
impl Send for SessionMiddleware
impl Sync for SessionMiddleware
impl Unpin for SessionMiddleware
impl UnsafeUnpin for SessionMiddleware
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