# Trait actix_identity::IdentityExt

source ·

    pub trait IdentityExt {
        // Required method
        fn get_identity(&self) -> Result<Identity, GetIdentityError>;
    }

Expand description

Helper trait to retrieve an `Identity` instance from various `actix-web`’s types.

## Required Methods§

source

#### fn get_identity(&self) -> Result<Identity, GetIdentityError>

Retrieve the identity attached to the current session, if available.

## Implementations on Foreign Types§

source§

### impl IdentityExt for HttpRequest

source§

#### fn get_identity(&self) -> Result<Identity, GetIdentityError>

source§

### impl IdentityExt for ServiceRequest

source§

#### fn get_identity(&self) -> Result<Identity, GetIdentityError>

source§

### impl<'a> IdentityExt for GuardContext<'a>

source§

#### fn get_identity(&self) -> Result<Identity, GetIdentityError>

## Implementors§