Skip to main content

UserStore

Trait UserStore 

Source
pub trait UserStore: Send + Sync {
    // Required methods
    fn create_user<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        email: &'life1 str,
        name: Option<&'life2 str>,
        password_hash: Option<&'life3 str>,
    ) -> Pin<Box<dyn Future<Output = Result<User, AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
    fn find_by_email<'life0, 'life1, 'async_trait>(
        &'life0 self,
        email: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<User>, AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn find_by_id<'life0, 'async_trait>(
        &'life0 self,
        id: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Option<User>, AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn set_email_verified<'life0, 'async_trait>(
        &'life0 self,
        user_id: i64,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn update_password<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: i64,
        password_hash: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn delete_user<'life0, 'async_trait>(
        &'life0 self,
        user_id: i64,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Storage backend for user records.

Required Methods§

Source

fn create_user<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, email: &'life1 str, name: Option<&'life2 str>, password_hash: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<User, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, Self: 'async_trait,

Source

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

Source

fn find_by_id<'life0, 'async_trait>( &'life0 self, id: i64, ) -> Pin<Box<dyn Future<Output = Result<Option<User>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn set_email_verified<'life0, 'async_trait>( &'life0 self, user_id: i64, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn update_password<'life0, 'life1, 'async_trait>( &'life0 self, user_id: i64, password_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn delete_user<'life0, 'async_trait>( &'life0 self, user_id: i64, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Implementations on Foreign Types§

Source§

impl UserStore for AuthDb

Source§

fn create_user<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, email: &'life1 str, name: Option<&'life2 str>, password_hash: Option<&'life3 str>, ) -> Pin<Box<dyn Future<Output = Result<User, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, AuthDb: 'async_trait,

Source§

fn find_by_email<'life0, 'life1, 'async_trait>( &'life0 self, email: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<User>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, AuthDb: 'async_trait,

Source§

fn find_by_id<'life0, 'async_trait>( &'life0 self, id: i64, ) -> Pin<Box<dyn Future<Output = Result<Option<User>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, AuthDb: 'async_trait,

Source§

fn set_email_verified<'life0, 'async_trait>( &'life0 self, user_id: i64, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, AuthDb: 'async_trait,

Source§

fn update_password<'life0, 'life1, 'async_trait>( &'life0 self, user_id: i64, password_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, AuthDb: 'async_trait,

Source§

fn delete_user<'life0, 'async_trait>( &'life0 self, user_id: i64, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, AuthDb: 'async_trait,

Implementors§