Struct actix_web::middleware::session::SessionStorage [−][src]
pub struct SessionStorage<T, S>(_, _);
Session storage middleware
use actix_web::middleware::session::{CookieSessionBackend, SessionStorage}; use actix_web::App; fn main() { let app = App::new().middleware(SessionStorage::new( // <- create session middleware CookieSessionBackend::signed(&[0; 32]) // <- create cookie session backend .secure(false), )); }
Methods
impl<S, T: SessionBackend<S>> SessionStorage<T, S>[src]
impl<S, T: SessionBackend<S>> SessionStorage<T, S>pub fn new(backend: T) -> SessionStorage<T, S>[src]
pub fn new(backend: T) -> SessionStorage<T, S>Create session storage
Trait Implementations
impl<S: 'static, T: SessionBackend<S>> Middleware<S> for SessionStorage<T, S>[src]
impl<S: 'static, T: SessionBackend<S>> Middleware<S> for SessionStorage<T, S>fn start(&self, req: &HttpRequest<S>) -> Result<Started>[src]
fn start(&self, req: &HttpRequest<S>) -> Result<Started>Method is called when request is ready. It may return future, which should resolve before next middleware get called. Read more
fn response(&self, req: &HttpRequest<S>, resp: HttpResponse) -> Result<Response>[src]
fn response(&self, req: &HttpRequest<S>, resp: HttpResponse) -> Result<Response>Method is called when handler returns response, but before sending http message to peer. Read more
fn finish(&self, req: &HttpRequest<S>, resp: &HttpResponse) -> Finished[src]
fn finish(&self, req: &HttpRequest<S>, resp: &HttpResponse) -> FinishedMethod is called after body stream get sent to peer.
Auto Trait Implementations
impl<T, S> Send for SessionStorage<T, S> where
S: Send,
T: Send,
impl<T, S> Send for SessionStorage<T, S> where
S: Send,
T: Send, impl<T, S> Sync for SessionStorage<T, S> where
S: Sync,
T: Sync,
impl<T, S> Sync for SessionStorage<T, S> where
S: Sync,
T: Sync,