Skip to main content

AdapterRecord

Struct AdapterRecord 

Source
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>

Source

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>

Source

pub const fn stored(&self) -> &M

Source

pub fn into_stored(self) -> M

Source

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>

Source§

impl<M: AuthSession> AuthSession for AdapterRecord<M>

Source§

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

Source§

fn additional_fields(&self) -> FieldOutput

Source§

fn id(&self) -> Cow<'_, str>

Source§

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

Source§

fn token(&self) -> &str

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn user_id(&self) -> Cow<'_, str>

Source§

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

Source§

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

Source§

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

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 retained_session_view(&self) -> Option<&SessionView>

Source§

impl<M: AuthUser> AuthUser for AdapterRecord<M>

Source§

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

A genuine retained adapter result, including declared undefined values.
Source§

fn additional_fields(&self) -> FieldOutput

Physical application/plugin values; public policy is applied separately.
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 two_factor_enabled_value(&self) -> Option<bool>

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

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

Source§

fn banned(&self) -> bool

Source§

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

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

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

Source§

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

Source§

fn metadata(&self) -> &Value

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>

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 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>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<M: Debug> Debug for AdapterRecord<M>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<M> Serialize for AdapterRecord<M>

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more