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§
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§
Sourcefn secondary_snapshot(&self) -> AuthResult<Value>
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.
Sourcefn from_secondary_snapshot(_snapshot: Value) -> AuthResult<Self>
fn from_secondary_snapshot(_snapshot: Value) -> AuthResult<Self>
Restore a model from a trusted secondary backend, before public projection.
Sourcefn adapter_snapshot(&self) -> Option<&AdapterOutput>
fn adapter_snapshot(&self) -> Option<&AdapterOutput>
A genuine retained adapter result, including declared undefined values.
Sourcefn retained_user_view(&self) -> Option<&UserView>
fn retained_user_view(&self) -> Option<&UserView>
A chosen authenticated view is already projected and must remain exact.
Sourcefn additional_fields(&self) -> FieldOutput
fn additional_fields(&self) -> FieldOutput
Physical application/plugin values; public policy is applied separately.
Sourcefn two_factor_enabled_value(&self) -> Option<bool>
fn two_factor_enabled_value(&self) -> Option<bool>
Persisted plugin state. None preserves an absent or unset field.
Sourcefn banned_value(&self) -> Option<bool>
fn banned_value(&self) -> Option<bool>
Persisted plugin state. None preserves an absent or unset field.
Sourcefn is_anonymous(&self) -> Option<bool>
fn is_anonymous(&self) -> Option<bool>
Anonymous-plugin state; None means the field is absent or unset.
fn phone_number(&self) -> Option<&str>
fn phone_number_verified(&self) -> Option<bool>
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".