shield

Trait Storage

Source
pub trait Storage<U: User>: Send + Sync {
    // Required methods
    fn id(&self) -> String;
    fn user_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<U>, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn user_by_email<'life0, 'life1, 'async_trait>(
        &'life0 self,
        email: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<U>, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_user<'life0, 'async_trait>(
        &'life0 self,
        user: CreateUser,
        email_address: CreateEmailAddress,
    ) -> Pin<Box<dyn Future<Output = Result<U, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_user<'life0, 'async_trait>(
        &'life0 self,
        user: UpdateUser,
    ) -> Pin<Box<dyn Future<Output = Result<U, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_user<'life0, 'life1, 'async_trait>(
        &'life0 self,
        user_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn id(&self) -> String

Source

fn user_by_id<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<U>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn user_by_email<'life0, 'life1, 'async_trait>( &'life0 self, email: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<U>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn create_user<'life0, 'async_trait>( &'life0 self, user: CreateUser, email_address: CreateEmailAddress, ) -> Pin<Box<dyn Future<Output = Result<U, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn update_user<'life0, 'async_trait>( &'life0 self, user: UpdateUser, ) -> Pin<Box<dyn Future<Output = Result<U, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn delete_user<'life0, 'life1, 'async_trait>( &'life0 self, user_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§