pub enum AuthenticatedUser<S: AuthSchema> {
Stored(AdapterRecord<S::User>),
Cached(Box<UserView>),
}Expand description
The identity established by a cache-aware session read.
This type does not imply that a cached identity still has a database row or current permissions. Sensitive stateful operations must use storage-backed authentication instead.
Variants§
Trait Implementations§
Source§impl<S: AuthSchema> AuthUser for AuthenticatedUser<S>
impl<S: AuthSchema> AuthUser for AuthenticatedUser<S>
Source§fn adapter_snapshot(&self) -> Option<&AdapterOutput>
fn adapter_snapshot(&self) -> Option<&AdapterOutput>
A genuine retained adapter result, including declared undefined values.
Source§fn retained_user_view(&self) -> Option<&UserView>
fn retained_user_view(&self) -> Option<&UserView>
A chosen authenticated view is already projected and must remain exact.
Source§fn additional_fields(&self) -> FieldOutput
fn additional_fields(&self) -> FieldOutput
Physical application/plugin values; public policy is applied separately.
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
Source§fn 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.fn role(&self) -> Option<&str>
fn banned(&self) -> bool
Source§fn banned_value(&self) -> Option<bool>
fn banned_value(&self) -> Option<bool>
Persisted plugin state.
None preserves an absent or unset field.fn ban_reason(&self) -> Option<&str>
fn ban_expires(&self) -> Option<DateTime<Utc>>
fn metadata(&self) -> &Value
Source§fn 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>
Source§fn 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.
Source§fn 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.
Source§impl<S: AuthSchema> Clone for AuthenticatedUser<S>
impl<S: AuthSchema> Clone for AuthenticatedUser<S>
Source§impl<S: AuthSchema> Debug for AuthenticatedUser<S>
impl<S: AuthSchema> Debug for AuthenticatedUser<S>
Source§impl<S: AuthSchema> Serialize for AuthenticatedUser<S>
impl<S: AuthSchema> Serialize for AuthenticatedUser<S>
Auto Trait Implementations§
impl<S> Freeze for AuthenticatedUser<S>
impl<S> RefUnwindSafe for AuthenticatedUser<S>
impl<S> Send for AuthenticatedUser<S>
impl<S> Sync for AuthenticatedUser<S>
impl<S> Unpin for AuthenticatedUser<S>
impl<S> UnsafeUnpin for AuthenticatedUser<S>
impl<S> UnwindSafe for AuthenticatedUser<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more