pub struct StartSession { /* private fields */ }Expand description
Loads the session before the handler and persists it afterwards.
A route without this middleware has no session, and
request.session() is None there —
which is the honest answer, and better than handing out a bag that silently
fails to persist.
Implementations§
Source§impl StartSession
impl StartSession
Sourcepub fn new(store: Arc<dyn SessionStore>) -> StartSession
pub fn new(store: Arc<dyn SessionStore>) -> StartSession
Start sessions in store, with the default cookie settings.
Sourcepub fn with_config(
store: Arc<dyn SessionStore>,
config: SessionConfig,
) -> StartSession
pub fn with_config( store: Arc<dyn SessionStore>, config: SessionConfig, ) -> StartSession
Start sessions with explicit cookie settings.
Sourcepub fn from_manager(manager: &SessionManager) -> StartSession
pub fn from_manager(manager: &SessionManager) -> StartSession
Take the settings and the store from a manager — the usual way, since the manager is what the container holds.
Trait Implementations§
Source§impl Debug for StartSession
impl Debug for StartSession
Auto Trait Implementations§
impl !RefUnwindSafe for StartSession
impl !UnwindSafe for StartSession
impl Freeze for StartSession
impl Send for StartSession
impl Sync for StartSession
impl Unpin for StartSession
impl UnsafeUnpin for StartSession
Blanket Implementations§
impl<T> Actor for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> ConcreteMiddleware for Twhere
T: Middleware,
impl<T> ConcreteMiddleware for Twhere
T: Middleware,
Source§fn concrete_type_id(&self) -> TypeId
fn concrete_type_id(&self) -> TypeId
The
TypeId of the implementing type.Source§fn concrete_type_name(&self) -> &'static str
fn concrete_type_name(&self) -> &'static str
Its fully-qualified type name.
Source§impl<T> Event for T
impl<T> Event for T
Source§fn event_name() -> &'static strwhere
Self: Sized,
fn event_name() -> &'static strwhere
Self: Sized,
A human-readable name, used by wildcard listeners and log output.
Always the Rust type path; see the trait docs.
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>
Converts
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>
Converts
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 moreSource§impl<M> IntoMiddlewareStack for Mwhere
M: Middleware,
impl<M> IntoMiddlewareStack for Mwhere
M: Middleware,
Source§fn into_middleware_stack(self) -> MiddlewareStack
fn into_middleware_stack(self) -> MiddlewareStack
Convert into a stack.
Creates a shared type from an unshared type.