Skip to main content

Identity

Trait Identity 

Source
pub trait Identity:
    Send
    + Sync
    + 'static {
    // Required method
    fn is_guest(&self) -> bool;

    // Provided method
    fn csrf_binding(&self) -> Option<&[u8]> { ... }
}
Expand description

Who is asking. A request that reaches a handler always carries one, possibly a guest.

Required Methods§

Source

fn is_guest(&self) -> bool

Whether this is a visitor with no signed-in session.

Provided Methods§

Source

fn csrf_binding(&self) -> Option<&[u8]>

The value CSRF tokens are bound to: the session id, or a pre-session id for a guest. None means no binding exists, and an unsafe method on a CSRF-protected route is refused.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§