pub struct StartSession;Expand description
Starts the session before the request is handled and saves it afterward, with the configured
driver. The web group includes this middleware.
The session is saved after the handler returns and before the response body is sent, so changes made while a streamed body is sent are lost.
Browsers ignore cookies larger than 4 KB. When the cookie driver’s encrypted session is
larger, the request fails in debug mode and in tests. Otherwise, the middleware reports the
error and sends the response, and the browser keeps its previous session. The session cookie
must stay encrypted, so excluding it from EncryptCookies makes every request fail.
To keep sessions in a store of your own, such as a package’s Memcached store, register the
store as a driver with Drivers::extend and select it with
SESSION_DRIVER.
Trait Implementations§
Source§impl Clone for StartSession
impl Clone for StartSession
Source§fn clone(&self) -> StartSession
fn clone(&self) -> StartSession
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for StartSession
Source§impl Debug for StartSession
impl Debug for StartSession
Source§impl Default for StartSession
impl Default for StartSession
Source§fn default() -> StartSession
fn default() -> StartSession
Auto Trait Implementations§
impl Forget for StartSession
impl Freeze for StartSession
impl Move for StartSession
impl RefUnwindSafe for StartSession
impl Send for StartSession
impl Sync for StartSession
impl Unpin for StartSession
impl UnsafeUnpin for StartSession
impl UnwindSafe for StartSession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<K> ForeignKey<K> for K
impl<K> ForeignKey<K> for K
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more