Struct actix_web::middleware::identity::IdentityService
source · pub struct IdentityService<T> { /* private fields */ }
Expand description
Request identity middleware
use actix_web::middleware::identity::{CookieIdentityPolicy, IdentityService};
use actix_web::App;
fn main() {
let app = App::new().middleware(IdentityService::new(
// <- create identity middleware
CookieIdentityPolicy::new(&[0; 32]) // <- create cookie session backend
.name("auth-cookie")
.secure(false),
));
}
Implementations
sourceimpl<T> IdentityService<T>
impl<T> IdentityService<T>
Trait Implementations
sourceimpl<S: 'static, T: IdentityPolicy<S>> Middleware<S> for IdentityService<T>
impl<S: 'static, T: IdentityPolicy<S>> Middleware<S> for IdentityService<T>
sourcefn start(&self, req: &HttpRequest<S>) -> Result<Started>
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
sourcefn response(&self, req: &HttpRequest<S>, resp: HttpResponse) -> Result<Response>
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
sourcefn finish(&self, req: &HttpRequest<S>, resp: &HttpResponse) -> Finished
fn finish(&self, req: &HttpRequest<S>, resp: &HttpResponse) -> Finished
Method is called after body stream get sent to peer.
Auto Trait Implementations
impl<T> RefUnwindSafe for IdentityService<T>where
T: RefUnwindSafe,
impl<T> Send for IdentityService<T>where
T: Send,
impl<T> Sync for IdentityService<T>where
T: Sync,
impl<T> Unpin for IdentityService<T>where
T: Unpin,
impl<T> UnwindSafe for IdentityService<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more