Trait mas_storage::user::UserTermsRepository

source ·
pub trait UserTermsRepository: Send + Sync {
    type Error;

    // Required method
    fn accept_terms<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 mut self,
        rng: &'life1 mut (dyn RngCore + Send),
        clock: &'life2 dyn Clock,
        user: &'life3 User,
        terms_url: Url,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

A UserTermsRepository helps interacting with the terms of service agreed by a [User]

Required Associated Types§

source

type Error

The error type returned by the repository

Required Methods§

source

fn accept_terms<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, rng: &'life1 mut (dyn RngCore + Send), clock: &'life2 dyn Clock, user: &'life3 User, terms_url: Url, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Accept the terms of service by a [User]

§Parameters
  • rng: A random number generator used to generate IDs
  • clock: The clock used to generate timestamps
  • user: The [User] accepting the terms
  • terms_url: The URL of the terms of service the user is accepting
§Errors

Returns Self::Error if the underlying repository fails

Implementations on Foreign Types§

source§

impl<R> UserTermsRepository for Box<R>

§

type Error = <R as UserTermsRepository>::Error

source§

fn accept_terms<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, rng: &'life1 mut (dyn RngCore + Send), clock: &'life2 dyn Clock, user: &'life3 User, terms_url: Url, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Implementors§

source§

impl<R, F, E> UserTermsRepository for MapErr<R, F>

§

type Error = E