pub trait UserOps:
Send
+ Sync
+ 'static {
type User: AuthUser;
// Required methods
fn create_user<'life0, 'async_trait>(
&'life0 self,
user: CreateUser,
) -> Pin<Box<dyn Future<Output = Result<Self::User, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
fn get_user_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::User>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_user_by_email<'life0, 'life1, 'async_trait>(
&'life0 self,
email: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::User>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn get_user_by_username<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::User>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn update_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
update: UpdateUser,
) -> Pin<Box<dyn Future<Output = Result<Self::User, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn list_users<'life0, 'async_trait>(
&'life0 self,
params: ListUsersParams,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Self::User>, usize), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
User persistence operations.
Required Associated Types§
Required Methods§
fn create_user<'life0, 'async_trait>(
&'life0 self,
user: CreateUser,
) -> Pin<Box<dyn Future<Output = Result<Self::User, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn get_user_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::User>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_user_by_email<'life0, 'life1, 'async_trait>(
&'life0 self,
email: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::User>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_user_by_username<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Self::User>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn update_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
update: UpdateUser,
) -> Pin<Box<dyn Future<Output = Result<Self::User, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sourcefn list_users<'life0, 'async_trait>(
&'life0 self,
params: ListUsersParams,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Self::User>, usize), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn list_users<'life0, 'async_trait>(
&'life0 self,
params: ListUsersParams,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Self::User>, usize), AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
List users with optional filtering, sorting, and pagination.
Returns (users, total_count).