pub struct AdapterRecord<M> { /* private fields */ }Expand description
One actual adapter result. Output transforms may change additional values or omit them, while identity, ownership and credential accessors retain the physical model. Public response filtering is a separate operation.
Implementations§
Source§impl<M: Serialize> AdapterRecord<M>
impl<M: Serialize> AdapterRecord<M>
Sourcepub fn physical(stored: M) -> AuthResult<Self>
pub fn physical(stored: M) -> AuthResult<Self>
Retain the model’s honest serialized snapshot without applying policies. Initialized stores replace this with their declared adapter output.
§Errors
Returns an error if the model cannot serialize to an object.
Source§impl<M> AdapterRecord<M>
impl<M> AdapterRecord<M>
pub const fn stored(&self) -> &M
pub fn into_stored(self) -> M
Sourcepub const fn raw_snapshot(&self) -> &AdapterOutput
pub const fn raw_snapshot(&self) -> &AdapterOutput
Trusted adapter output, including declared returned: false fields.
This snapshot is immutable and must not be used as storage authority.
Trait Implementations§
Source§impl<M: AuthAccount> AuthAccount for AdapterRecord<M>
impl<M: AuthAccount> AuthAccount for AdapterRecord<M>
fn adapter_snapshot(&self) -> Option<&AdapterOutput>
fn additional_fields(&self) -> FieldOutput
fn id(&self) -> Cow<'_, str>
fn account_id(&self) -> &str
fn provider_id(&self) -> &str
fn user_id(&self) -> Cow<'_, str>
fn access_token(&self) -> Option<&str>
fn refresh_token(&self) -> Option<&str>
fn id_token(&self) -> Option<&str>
fn access_token_expires_at(&self) -> Option<DateTime<Utc>>
fn refresh_token_expires_at(&self) -> Option<DateTime<Utc>>
fn scope(&self) -> Option<&str>
fn password(&self) -> Option<&str>
fn created_at(&self) -> DateTime<Utc>
fn updated_at(&self) -> DateTime<Utc>
Source§impl<M: AuthSession> AuthSession for AdapterRecord<M>
impl<M: AuthSession> AuthSession for AdapterRecord<M>
fn adapter_snapshot(&self) -> Option<&AdapterOutput>
fn additional_fields(&self) -> FieldOutput
fn id(&self) -> Cow<'_, str>
fn expires_at(&self) -> DateTime<Utc>
fn token(&self) -> &str
fn created_at(&self) -> DateTime<Utc>
fn updated_at(&self) -> DateTime<Utc>
fn ip_address(&self) -> Option<&str>
fn user_agent(&self) -> Option<&str>
fn user_id(&self) -> Cow<'_, str>
fn impersonated_by(&self) -> Option<&str>
fn active_organization_id(&self) -> Option<&str>
fn active_team_id(&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.
fn retained_session_view(&self) -> Option<&SessionView>
Source§impl<M: AuthUser> AuthUser for AdapterRecord<M>
impl<M: AuthUser> AuthUser for AdapterRecord<M>
Source§fn adapter_snapshot(&self) -> Option<&AdapterOutput>
fn adapter_snapshot(&self) -> Option<&AdapterOutput>
A genuine retained adapter result, including declared undefined values.
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§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§impl<M: Clone> Clone for AdapterRecord<M>
impl<M: Clone> Clone for AdapterRecord<M>
Source§impl<M: Debug> Debug for AdapterRecord<M>
impl<M: Debug> Debug for AdapterRecord<M>
Auto Trait Implementations§
impl<M> Freeze for AdapterRecord<M>where
M: Freeze,
impl<M> RefUnwindSafe for AdapterRecord<M>where
M: RefUnwindSafe,
impl<M> Send for AdapterRecord<M>where
M: Send,
impl<M> Sync for AdapterRecord<M>where
M: Sync,
impl<M> Unpin for AdapterRecord<M>where
M: Unpin,
impl<M> UnsafeUnpin for AdapterRecord<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for AdapterRecord<M>where
M: UnwindSafe,
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