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§
Sourcefn 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<'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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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