Skip to main content

UserMapper

Trait UserMapper 

Source
pub trait UserMapper: Send + Sync {
    type LocalUser: Send + Sync;

    // Required method
    fn map_user<'life0, 'life1, 'async_trait>(
        &'life0 self,
        identity: &'life1 Identity,
    ) -> Pin<Box<dyn Future<Output = Result<Self::LocalUser, AuthError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Trait for mapping a provider identity to a local user.

Required Associated Types§

Source

type LocalUser: Send + Sync

The type of the local user object.

Required Methods§

Source

fn map_user<'life0, 'life1, 'async_trait>( &'life0 self, identity: &'life1 Identity, ) -> Pin<Box<dyn Future<Output = Result<Self::LocalUser, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Map an identity to a local user. This could involve creating a new user or finding an existing one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl UserMapper for ()

Source§

type LocalUser = ()

Source§

fn map_user<'life0, 'life1, 'async_trait>( &'life0 self, _identity: &'life1 Identity, ) -> Pin<Box<dyn Future<Output = Result<Self::LocalUser, AuthError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§