Skip to main content

AccountStore

Trait AccountStore 

Source
pub trait AccountStore<S: AuthSchema>: Send + Sync {
    // Required methods
    fn create_account<'life0, 'async_trait>(
        &'life0 self,
        create_account: CreateAccount,
    ) -> Pin<Box<dyn Future<Output = AuthResult<S::Account>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_account<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        provider: &'life1 str,
        provider_account_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Option<S::Account>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn get_user_accounts<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<S::Account>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_account<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        update: UpdateAccount,
    ) -> Pin<Box<dyn Future<Output = AuthResult<S::Account>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_account<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn provider_token_text<'life0, 'life1, 'async_trait>(
        &'life0 self,
        value: &'life1 Value,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn create_account_record<'life0, 'async_trait>(
        &'life0 self,
        create_account: CreateAccount,
    ) -> Pin<Box<dyn Future<Output = AuthResult<AdapterRecord<S::Account>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn get_account_record<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        provider: &'life1 str,
        provider_account_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Option<AdapterRecord<S::Account>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn get_credential_account_record<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Option<AdapterRecord<S::Account>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn get_user_accounts_record<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<AdapterRecord<S::Account>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn update_account_record<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        update: UpdateAccount,
    ) -> Pin<Box<dyn Future<Output = AuthResult<AdapterRecord<S::Account>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}

Required Methods§

Source

fn create_account<'life0, 'async_trait>( &'life0 self, create_account: CreateAccount, ) -> Pin<Box<dyn Future<Output = AuthResult<S::Account>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_account<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, provider: &'life1 str, provider_account_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<S::Account>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Resolve a global provider identity only when exactly one physical row matches. Duplicate rows (including duplicates owned by one user) must return DatabaseError::AmbiguousAccount; choosing a row would make ownership arbitrary.

Source

fn get_user_accounts<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<S::Account>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return all scoped physical rows in the adapter’s native order. Do not select or collapse duplicate provider identities, or sort by mutable dates.

Source

fn update_account<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, update: UpdateAccount, ) -> Pin<Box<dyn Future<Output = AuthResult<S::Account>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn delete_account<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn provider_token_text<'life0, 'life1, 'async_trait>( &'life0 self, value: &'life1 Value, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Apply the physical token TEXT column’s scalar affinity before persistence. SQL adapters override this for their own boolean/numeric representation.

Source

fn create_account_record<'life0, 'async_trait>( &'life0 self, create_account: CreateAccount, ) -> Pin<Box<dyn Future<Output = AuthResult<AdapterRecord<S::Account>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return a retained adapter record. The default is the physical model’s serialized snapshot; initialized stores apply their declared output policy.

Source

fn get_account_record<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, provider: &'life1 str, provider_account_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<AdapterRecord<S::Account>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Return a retained adapter record. The default is the physical model’s serialized snapshot; initialized stores apply their declared output policy.

Source

fn get_credential_account_record<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<AdapterRecord<S::Account>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return a retained adapter record. The default is the physical model’s serialized snapshot; initialized stores apply their declared output policy. Retain the selected physical credential result. Initialization applies output policy only to that selected row, never unrelated linked accounts.

Source

fn get_user_accounts_record<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<AdapterRecord<S::Account>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_account_record<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, update: UpdateAccount, ) -> Pin<Box<dyn Future<Output = AuthResult<AdapterRecord<S::Account>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Return a retained adapter record. The default is the physical model’s serialized snapshot; initialized stores apply their declared output policy.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§