UserStore

Trait UserStore 

Source
pub trait UserStore: Send + Sync {
    // Required methods
    fn get_user<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 UserId,
    ) -> Pin<Box<dyn Future<Output = 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 = Option<User>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_user_by_oauth<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        provider: &'life1 str,
        subject: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Option<User>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn upsert_user<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user: &'life1 User,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete_user<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 UserId,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_users<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<User>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_users_in_group<'life0, 'life1, 'async_trait>(
        &'life0 self,
        group: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Vec<User>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

User store trait for different backends

Required Methods§

Source

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

Get user by ID

Source

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

Get user by email

Source

fn get_user_by_oauth<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, provider: &'life1 str, subject: &'life2 str, ) -> Pin<Box<dyn Future<Output = Option<User>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get user by OAuth2 subject

Source

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

Create or update user

Source

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

Delete user

Source

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

List all users

Source

fn get_users_in_group<'life0, 'life1, 'async_trait>( &'life0 self, group: &'life1 str, ) -> Pin<Box<dyn Future<Output = Vec<User>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get users in a group

Implementors§