Trait actix_identity::IdentityPolicy[][src]

pub trait IdentityPolicy: Sized + 'static {
    type Future: Future<Output = Result<Option<String>, Error>>;
    type ResponseFuture: Future<Output = Result<(), Error>>;
    fn from_request(&self, req: &mut ServiceRequest) -> Self::Future;
fn to_response<B>(
        &self,
        identity: Option<String>,
        changed: bool,
        response: &mut ServiceResponse<B>
    ) -> Self::ResponseFuture; }

Identity policy.

Associated Types

type Future: Future<Output = Result<Option<String>, Error>>[src]

The return type of the middleware

type ResponseFuture: Future<Output = Result<(), Error>>[src]

The return type of the middleware

Loading content...

Required methods

fn from_request(&self, req: &mut ServiceRequest) -> Self::Future[src]

Parse the session from request and load data from a service identity.

fn to_response<B>(
    &self,
    identity: Option<String>,
    changed: bool,
    response: &mut ServiceResponse<B>
) -> Self::ResponseFuture
[src]

Write changes to response

Loading content...

Implementors

impl IdentityPolicy for CookieIdentityPolicy[src]

type Future = Ready<Result<Option<String>, Error>>

type ResponseFuture = Ready<Result<(), Error>>

Loading content...