Skip to main content

AuthUser

Trait AuthUser 

Source
pub trait AuthUser:
    Clone
    + Send
    + Sync
    + Serialize
    + Debug
    + 'static {
Show 26 methods // Required methods fn id(&self) -> Cow<'_, 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 methods fn secondary_snapshot(&self) -> AuthResult<Value> { ... } fn from_secondary_snapshot(_snapshot: Value) -> AuthResult<Self> { ... } fn adapter_snapshot(&self) -> Option<&AdapterOutput> { ... } fn retained_user_view(&self) -> Option<&UserView> { ... } fn additional_fields(&self) -> FieldOutput { ... } fn two_factor_enabled_value(&self) -> Option<bool> { ... } fn banned_value(&self) -> Option<bool> { ... } fn is_anonymous(&self) -> Option<bool> { ... } fn phone_number(&self) -> Option<&str> { ... } fn phone_number_verified(&self) -> Option<bool> { ... } fn last_login_method(&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) -> Cow<'_, 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 secondary_snapshot(&self) -> AuthResult<Value>

Encode the complete typed model for a trusted secondary backend. Custom entities can opt in without adding a Deserialize bound to all schemas.

Source

fn from_secondary_snapshot(_snapshot: Value) -> AuthResult<Self>

Restore a model from a trusted secondary backend, before public projection.

Source

fn adapter_snapshot(&self) -> Option<&AdapterOutput>

A genuine retained adapter result, including declared undefined values.

Source

fn retained_user_view(&self) -> Option<&UserView>

A chosen authenticated view is already projected and must remain exact.

Source

fn additional_fields(&self) -> FieldOutput

Physical application/plugin values; public policy is applied separately.

Source

fn two_factor_enabled_value(&self) -> Option<bool>

Persisted plugin state. None preserves an absent or unset field.

Source

fn banned_value(&self) -> Option<bool>

Persisted plugin state. None preserves an absent or unset field.

Source

fn is_anonymous(&self) -> Option<bool>

Anonymous-plugin state; None means the field is absent or unset.

Source

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

Source

fn phone_number_verified(&self) -> Option<bool>

Source

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

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§