pub struct IdentityService<T> { /* private fields */ }Expand description
Request identity middleware
use actix_web::App;
use actix_identity::{CookieIdentityPolicy, IdentityService};
let app = App::new().wrap(IdentityService::new(
// <- create identity middleware
CookieIdentityPolicy::new(&[0; 32]) // <- create cookie session backend
.name("auth-cookie")
.secure(false),
));Implementations§
Source§impl<T> IdentityService<T>
impl<T> IdentityService<T>
Sourcepub fn new(backend: T) -> IdentityService<T>
pub fn new(backend: T) -> IdentityService<T>
Create new identity service with specified backend.
Trait Implementations§
Source§impl<S, T, B> Transform<S> for IdentityService<T>where
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
<S as Service>::Future: 'static,
T: IdentityPolicy,
B: 'static,
impl<S, T, B> Transform<S> for IdentityService<T>where
S: Service<Request = ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
<S as Service>::Future: 'static,
T: IdentityPolicy,
B: 'static,
Source§type Request = ServiceRequest
type Request = ServiceRequest
Requests handled by the service.
Source§type Response = ServiceResponse<B>
type Response = ServiceResponse<B>
Responses given by the service.
Source§type Transform = IdentityServiceMiddleware<S, T>
type Transform = IdentityServiceMiddleware<S, T>
The
TransformService value created by this factorySource§type Future = Ready<Result<<IdentityService<T> as Transform<S>>::Transform, <IdentityService<T> as Transform<S>>::InitError>>
type Future = Ready<Result<<IdentityService<T> as Transform<S>>::Transform, <IdentityService<T> as Transform<S>>::InitError>>
The future response value.
Source§fn new_transform(
&self,
service: S,
) -> <IdentityService<T> as Transform<S>>::Future
fn new_transform( &self, service: S, ) -> <IdentityService<T> as Transform<S>>::Future
Creates and returns a new Transform component, asynchronously
Source§fn map_init_err<F, E>(self, f: F) -> TransformMapInitErr<Self, S, F, E>
fn map_init_err<F, E>(self, f: F) -> TransformMapInitErr<Self, S, F, E>
Map this transforms’s factory error to a different error,
returning a new transform service factory.
Auto Trait Implementations§
impl<T> Freeze for IdentityService<T>
impl<T> RefUnwindSafe for IdentityService<T>where
T: RefUnwindSafe,
impl<T> !Send for IdentityService<T>
impl<T> !Sync for IdentityService<T>
impl<T> Unpin for IdentityService<T>
impl<T> UnwindSafe for IdentityService<T>where
T: RefUnwindSafe,
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
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> 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 more