Skip to main content

UserProvider

Trait UserProvider 

Source
pub trait UserProvider: Send + Sync {
    // Required methods
    fn find_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AuthUser>, AuthProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: '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<AuthUser>, AuthProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn find_by_name<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AuthUser>, AuthProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn create_user<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        email: &'life2 str,
        full_name: Option<&'life3 str>,
    ) -> Pin<Box<dyn Future<Output = Result<AuthUser, AuthProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             Self: 'async_trait;
    fn create_anonymous<'life0, 'life1, 'async_trait>(
        &'life0 self,
        fingerprint: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<AuthUser, AuthProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn assign_roles<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
        roles: &'life2 [String],
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthProviderError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
}

Required Methods§

Source

fn find_by_id<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthUser>, AuthProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: '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<AuthUser>, AuthProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn find_by_name<'life0, 'life1, 'async_trait>( &'life0 self, name: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AuthUser>, AuthProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

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

Source

fn create_anonymous<'life0, 'life1, 'async_trait>( &'life0 self, fingerprint: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<AuthUser, AuthProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn assign_roles<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, user_id: &'life1 str, roles: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<(), AuthProviderError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Implementors§