Skip to main content

AuthUser

Trait AuthUser 

Source
pub trait AuthUser:
    Clone
    + Send
    + Sync
    + Serialize
    + Debug
    + 'static {
Show 16 methods // Required methods fn id(&self) -> &str; fn email(&self) -> Option<&str>; fn name(&self) -> Option<&str>; fn email_verified(&self) -> bool; fn image(&self) -> Option<&str>; fn created_at(&self) -> DateTime<Utc>; fn updated_at(&self) -> DateTime<Utc>; fn username(&self) -> Option<&str>; fn display_username(&self) -> Option<&str>; fn two_factor_enabled(&self) -> bool; fn role(&self) -> Option<&str>; fn banned(&self) -> bool; fn ban_reason(&self) -> Option<&str>; fn ban_expires(&self) -> Option<DateTime<Utc>>; fn metadata(&self) -> &Value; // Provided method fn password_hash(&self) -> Option<&str> { ... }
}
Expand description

Trait representing a user entity.

The framework reads user fields through these getters. Custom types must provide all framework fields and may have additional fields.

Required Methods§

Source

fn id(&self) -> &str

Source

fn email(&self) -> Option<&str>

Source

fn name(&self) -> Option<&str>

Source

fn email_verified(&self) -> bool

Source

fn image(&self) -> Option<&str>

Source

fn created_at(&self) -> DateTime<Utc>

Source

fn updated_at(&self) -> DateTime<Utc>

Source

fn username(&self) -> Option<&str>

Source

fn display_username(&self) -> Option<&str>

Source

fn two_factor_enabled(&self) -> bool

Source

fn role(&self) -> Option<&str>

Source

fn banned(&self) -> bool

Source

fn ban_reason(&self) -> Option<&str>

Source

fn ban_expires(&self) -> Option<DateTime<Utc>>

Source

fn metadata(&self) -> &Value

Provided Methods§

Source

fn password_hash(&self) -> Option<&str>

Extract the stored password hash from the user metadata.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§