Skip to main content

AuthExt

Trait AuthExt 

Source
pub trait AuthExt {
    // Required methods
    fn try_auth(&self) -> Option<Guard>;
    fn auth(&self) -> Guard;
    fn identity(&self) -> Option<&Identity>;
}
Expand description

req.auth() and req.identity() — reaching authentication from a handler.

Required Methods§

Source

fn try_auth(&self) -> Option<Guard>

The guard, or None when the session middleware is not installed.

Source

fn auth(&self) -> Guard

The guard, panicking with an actionable message if there is no session.

Source

fn identity(&self) -> Option<&Identity>

The identity attached by the auth middleware.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AuthExt for Request

Implementors§