pub trait UserEmailRepository: Send + Sync {
    type Error;
Show 14 methods
    // Required methods
    fn lookup<'life0, 'async_trait>(
        &'life0 mut self,
        id: Ulid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<UserEmail>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        user: &'life1 User,
        email: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<UserEmail>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn all<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        user: &'life1 User,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<UserEmail>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        filter: UserEmailFilter<'life1>,
        pagination: Pagination,
    ) -> Pin<Box<dyn Future<Output = Result<Page<UserEmail>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn count<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        filter: UserEmailFilter<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 mut self,
        rng: &'life1 mut (dyn RngCore + Send),
        clock: &'life2 dyn Clock,
        user: &'life3 User,
        email: String,
    ) -> Pin<Box<dyn Future<Output = Result<UserEmail, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn remove<'life0, 'async_trait>(
        &'life0 mut self,
        user_email: UserEmail,
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn remove_bulk<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        filter: UserEmailFilter<'life1>,
    ) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn add_authentication_for_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 mut self,
        rng: &'life1 mut (dyn RngCore + Send),
        clock: &'life2 dyn Clock,
        email: String,
        session: &'life3 BrowserSession,
    ) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthentication, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn add_authentication_for_registration<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 mut self,
        rng: &'life1 mut (dyn RngCore + Send),
        clock: &'life2 dyn Clock,
        email: String,
        registration: &'life3 UserRegistration,
    ) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthentication, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn add_authentication_code<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 mut self,
        rng: &'life1 mut (dyn RngCore + Send),
        clock: &'life2 dyn Clock,
        duration: Duration,
        authentication: &'life3 UserEmailAuthentication,
        code: String,
    ) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthenticationCode, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
    fn lookup_authentication<'life0, 'async_trait>(
        &'life0 mut self,
        id: Ulid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<UserEmailAuthentication>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_authentication_code<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        authentication: &'life1 UserEmailAuthentication,
        code: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<UserEmailAuthenticationCode>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn complete_authentication<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        clock: &'life1 dyn Clock,
        authentication: UserEmailAuthentication,
        code: &'life2 UserEmailAuthenticationCode,
    ) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthentication, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}Expand description
A UserEmailRepository helps interacting with UserEmail saved in the
storage backend
Required Associated Types§
Required Methods§
Sourcefn lookup<'life0, 'async_trait>(
    &'life0 mut self,
    id: Ulid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserEmail>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn lookup<'life0, 'async_trait>(
    &'life0 mut self,
    id: Ulid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserEmail>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Sourcefn find<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    user: &'life1 User,
    email: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<UserEmail>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
 
fn find<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    user: &'life1 User,
    email: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<UserEmail>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
Sourcefn all<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserEmail>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn all<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    user: &'life1 User,
) -> Pin<Box<dyn Future<Output = Result<Vec<UserEmail>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Sourcefn list<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    filter: UserEmailFilter<'life1>,
    pagination: Pagination,
) -> Pin<Box<dyn Future<Output = Result<Page<UserEmail>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn list<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    filter: UserEmailFilter<'life1>,
    pagination: Pagination,
) -> Pin<Box<dyn Future<Output = Result<Page<UserEmail>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
List UserEmail with the given filter and pagination
§Parameters
- filter: The filter parameters
- pagination: The pagination parameters
§Errors
Returns Self::Error if the underlying repository fails
Sourcefn count<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    filter: UserEmailFilter<'life1>,
) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn count<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    filter: UserEmailFilter<'life1>,
) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Count the UserEmail with the given filter
§Parameters
- filter: The filter parameters
§Errors
Returns Self::Error if the underlying repository fails
Sourcefn add<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    rng: &'life1 mut (dyn RngCore + Send),
    clock: &'life2 dyn Clock,
    user: &'life3 User,
    email: String,
) -> Pin<Box<dyn Future<Output = Result<UserEmail, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
 
fn add<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    rng: &'life1 mut (dyn RngCore + Send),
    clock: &'life2 dyn Clock,
    user: &'life3 User,
    email: String,
) -> Pin<Box<dyn Future<Output = Result<UserEmail, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
Sourcefn remove<'life0, 'async_trait>(
    &'life0 mut self,
    user_email: UserEmail,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn remove<'life0, 'async_trait>(
    &'life0 mut self,
    user_email: UserEmail,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Delete a UserEmail
§Parameters
- user_email: The- UserEmailto delete
§Errors
Returns Self::Error if the underlying repository fails
Sourcefn remove_bulk<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    filter: UserEmailFilter<'life1>,
) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn remove_bulk<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    filter: UserEmailFilter<'life1>,
) -> Pin<Box<dyn Future<Output = Result<usize, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Delete all UserEmail with the given filter
Returns the number of deleted UserEmails
§Parameters
- filter: The filter parameters
§Errors
Returns Self::Error if the underlying repository fails
Sourcefn add_authentication_for_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    rng: &'life1 mut (dyn RngCore + Send),
    clock: &'life2 dyn Clock,
    email: String,
    session: &'life3 BrowserSession,
) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthentication, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
 
fn add_authentication_for_session<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    rng: &'life1 mut (dyn RngCore + Send),
    clock: &'life2 dyn Clock,
    email: String,
    session: &'life3 BrowserSession,
) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthentication, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
Add a new UserEmailAuthentication for a BrowserSession
§Parameters
- rng: The random number generator to use
- clock: The clock to use
- email: The email address to add
- session: The- BrowserSessionfor which to add the- UserEmailAuthentication
§Errors
Returns an error if the underlying repository fails
Sourcefn add_authentication_for_registration<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    rng: &'life1 mut (dyn RngCore + Send),
    clock: &'life2 dyn Clock,
    email: String,
    registration: &'life3 UserRegistration,
) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthentication, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
 
fn add_authentication_for_registration<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    rng: &'life1 mut (dyn RngCore + Send),
    clock: &'life2 dyn Clock,
    email: String,
    registration: &'life3 UserRegistration,
) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthentication, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
Add a new UserEmailAuthentication for a UserRegistration
§Parameters
- rng: The random number generator to use
- clock: The clock to use
- email: The email address to add
- registration: The- UserRegistrationfor which to add the- UserEmailAuthentication
§Errors
Returns an error if the underlying repository fails
Sourcefn add_authentication_code<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    rng: &'life1 mut (dyn RngCore + Send),
    clock: &'life2 dyn Clock,
    duration: Duration,
    authentication: &'life3 UserEmailAuthentication,
    code: String,
) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthenticationCode, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
 
fn add_authentication_code<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 mut self,
    rng: &'life1 mut (dyn RngCore + Send),
    clock: &'life2 dyn Clock,
    duration: Duration,
    authentication: &'life3 UserEmailAuthentication,
    code: String,
) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthenticationCode, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
Add a new UserEmailAuthenticationCode for a
UserEmailAuthentication
§Parameters
- rng: The random number generator to use
- clock: The clock to use
- duration: The duration for which the code is valid
- authentication: The- UserEmailAuthenticationfor which to add the- UserEmailAuthenticationCode
- code: The code to add
§Errors
Returns an error if the underlying repository fails or if the code already exists for this session
Sourcefn lookup_authentication<'life0, 'async_trait>(
    &'life0 mut self,
    id: Ulid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserEmailAuthentication>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn lookup_authentication<'life0, 'async_trait>(
    &'life0 mut self,
    id: Ulid,
) -> Pin<Box<dyn Future<Output = Result<Option<UserEmailAuthentication>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Lookup a UserEmailAuthentication
§Parameters
- id: The ID of the- UserEmailAuthenticationto lookup
§Errors
Returns an error if the underlying repository fails
Sourcefn find_authentication_code<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    authentication: &'life1 UserEmailAuthentication,
    code: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<UserEmailAuthenticationCode>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
 
fn find_authentication_code<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    authentication: &'life1 UserEmailAuthentication,
    code: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<UserEmailAuthenticationCode>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
Find a UserEmailAuthenticationCode by its code and session
§Parameters
- authentication: The- UserEmailAuthenticationto find the code for
- code: The code of the- UserEmailAuthenticationto lookup
§Errors
Returns an error if the underlying repository fails
Sourcefn complete_authentication<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    clock: &'life1 dyn Clock,
    authentication: UserEmailAuthentication,
    code: &'life2 UserEmailAuthenticationCode,
) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthentication, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
 
fn complete_authentication<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    clock: &'life1 dyn Clock,
    authentication: UserEmailAuthentication,
    code: &'life2 UserEmailAuthenticationCode,
) -> Pin<Box<dyn Future<Output = Result<UserEmailAuthentication, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
Complete a UserEmailAuthentication by using the given code
Returns the completed UserEmailAuthentication
§Parameters
- clock: The clock to use to generate timestamps
- authentication: The- UserEmailAuthenticationto complete
- code: The- UserEmailAuthenticationCodeto use
§Errors
Returns an error if the underlying repository fails