# IdentityExt in actix_identity - Rust
Helper trait to retrieve an [`Identity`] instance from various `actix-web`’s types.
Keywords: rust, rustlang, rust-lang, IdentityExt

# Trait actix_identity::IdentityExt

source · [−]

    pub trait IdentityExt {
        fn get_identity(&self) -> Result<Identity, Error>;
    }

Expand description

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

## Required Methods

source

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

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, Error>

source

### impl IdentityExt for ServiceRequest

source

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

source

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

source

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

## Implementors