Skip to main content

InMemoryAccountBackend

Struct InMemoryAccountBackend 

Source
pub struct InMemoryAccountBackend { /* private fields */ }
Expand description

In-memory account backend (default). Lost on restart — production deployments should swap in a persistent backend so refresh tokens survive a redeploy.

Implementations§

Trait Implementations§

Source§

impl AccountBackend for InMemoryAccountBackend

Source§

fn upsert(&self, account: &Account)

Insert or refresh an account link. The (provider_id, account_id) pair is the natural key — repeated calls for the same pair update the token bundle and updated_at on the existing row.
Source§

fn find_by_provider( &self, provider_id: &str, account_id: &str, ) -> Option<Account>

Find an account by provider identity. Returns None if the user hasn’t linked this provider yet.
Source§

fn find_for_user(&self, user_id: &str) -> Vec<Account>

Every account linked to a user. The /api/auth/me endpoint uses this to render “you’re connected via Google + GitHub” in the UI and to gate “unlink” affordances behind “user has another way to sign in” checks.
Remove a single provider link. Returns true if a row was removed.
Source§

fn list_all(&self) -> Vec<Account>

Every account in the store. Used by AccountStore::list_all_unfiltered to power the Studio admin inspector. Backends that can stream (SQLite, Postgres) just SELECT *; the in-memory backend returns its full map.
Source§

impl Default for InMemoryAccountBackend

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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