# RequestIdentity in actix_identity - Rust
Helper trait that allows to get Identity.
Keywords: rust, rustlang, rust-lang, RequestIdentity

# Trait actix_identity::RequestIdentity

source · [−]

    pub trait RequestIdentity {
        fn get_identity(&self) -> Option<String>;
    }

Expand description

Helper trait that allows to get Identity.

It could be used in middleware but identity policy must be set before any other middleware that needs identity. RequestIdentity is implemented both for `ServiceRequest` and `HttpRequest`.

## Required methods

source

#### fn get_identity(&self) -> Option<String>

## Implementors

source

### impl<T> RequestIdentity for T where
T: HttpMessage,