pub struct SessionLayer { /* private fields */ }Expand description
Tower Layer that installs the session middleware into the request pipeline.
Construct with layer rather than directly. Apply before route handlers
with Router::layer(session_layer).
The middleware reads the signed session cookie, loads the session from the
database, validates the browser fingerprint (when configured), and inserts
an Arc<SessionState> into the request extensions so the super::extractor::Session
extractor can access it.
On the response path it flushes dirty session data, touches the expiry timestamp, and sets or clears the session cookie as needed.
Trait Implementations§
Source§impl Clone for SessionLayer
impl Clone for SessionLayer
Source§fn clone(&self) -> SessionLayer
fn clone(&self) -> SessionLayer
Returns a duplicate of the value. Read more
1.0.0 · 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 Freeze for SessionLayer
impl !RefUnwindSafe for SessionLayer
impl Send for SessionLayer
impl Sync for SessionLayer
impl Unpin for SessionLayer
impl UnsafeUnpin for SessionLayer
impl !UnwindSafe for SessionLayer
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