Skip to main content

DatabaseAdapter

Trait DatabaseAdapter 

Source
pub trait DatabaseAdapter: Send + Sync {
Show 22 methods // Required methods fn create_user<'life0, 'async_trait>( &'life0 self, user: CreateUser, ) -> Pin<Box<dyn Future<Output = AuthResult<User>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_user_by_id<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<User>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_user_by_email<'life0, 'life1, 'async_trait>( &'life0 self, email: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<User>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_user_by_username<'life0, 'life1, 'async_trait>( &'life0 self, username: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<User>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_user<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, update: UpdateUser, ) -> Pin<Box<dyn Future<Output = AuthResult<User>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_user<'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; fn create_session<'life0, 'async_trait>( &'life0 self, session: CreateSession, ) -> Pin<Box<dyn Future<Output = AuthResult<Session>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_session<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Session>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_user_sessions<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<Session>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_session_expiry<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, expires_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_session<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_user_sessions<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_expired_sessions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = AuthResult<usize>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn create_account<'life0, 'async_trait>( &'life0 self, account: CreateAccount, ) -> Pin<Box<dyn Future<Output = AuthResult<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<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<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; fn create_verification<'life0, 'async_trait>( &'life0 self, verification: CreateVerification, ) -> Pin<Box<dyn Future<Output = AuthResult<Verification>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_verification<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, identifier: &'life1 str, value: &'life2 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Verification>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn get_verification_by_value<'life0, 'life1, 'async_trait>( &'life0 self, value: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Verification>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn delete_verification<'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; fn delete_expired_verifications<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = AuthResult<usize>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

Database adapter trait for persistence

Required Methods§

Source

fn create_user<'life0, 'async_trait>( &'life0 self, user: CreateUser, ) -> Pin<Box<dyn Future<Output = AuthResult<User>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

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

Source

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

Source

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

Source

fn delete_user<'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,

Source

fn create_session<'life0, 'async_trait>( &'life0 self, session: CreateSession, ) -> Pin<Box<dyn Future<Output = AuthResult<Session>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

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

Source

fn update_session_expiry<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, expires_at: DateTime<Utc>, ) -> Pin<Box<dyn Future<Output = AuthResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

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

Source

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

Source

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

Source

fn create_account<'life0, 'async_trait>( &'life0 self, account: CreateAccount, ) -> Pin<Box<dyn Future<Output = AuthResult<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<Account>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn get_user_accounts<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Vec<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,

Source

fn create_verification<'life0, 'async_trait>( &'life0 self, verification: CreateVerification, ) -> Pin<Box<dyn Future<Output = AuthResult<Verification>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_verification<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, identifier: &'life1 str, value: &'life2 str, ) -> Pin<Box<dyn Future<Output = AuthResult<Option<Verification>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

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

Source

fn delete_verification<'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,

Source

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

Implementors§