Skip to main content

UserOps

Trait UserOps 

Source
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§

Source

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,

Source

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,

Source

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,

Source

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,

Source

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,

Source

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,

Source

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).

Implementors§

Source§

impl<DB> UserOps for HookedDatabaseAdapter<DB>
where DB: DatabaseAdapter,

Source§

type User = <DB as UserOps>::User

Source§

impl<U, S, A, O, M, I, V, P> UserOps for MemoryDatabaseAdapter<U, S, A, O, M, I, V, P>

Source§

type User = U