pub trait UserRegistrationRepository: Send + Sync {
    type Error;
    // Required methods
    fn lookup<'life0, 'async_trait>(
        &'life0 mut self,
        id: Ulid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<UserRegistration>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn add<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        rng: &'life1 mut (dyn RngCore + Send),
        clock: &'life2 dyn Clock,
        username: String,
        ip_address: Option<IpAddr>,
        user_agent: Option<String>,
        post_auth_action: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn set_display_name<'life0, 'async_trait>(
        &'life0 mut self,
        user_registration: UserRegistration,
        display_name: String,
    ) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_terms_url<'life0, 'async_trait>(
        &'life0 mut self,
        user_registration: UserRegistration,
        terms_url: Url,
    ) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_email_authentication<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        user_registration: UserRegistration,
        email_authentication: &'life1 UserEmailAuthentication,
    ) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set_password<'life0, 'async_trait>(
        &'life0 mut self,
        user_registration: UserRegistration,
        hashed_password: String,
        version: u16,
    ) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn complete<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        clock: &'life1 dyn Clock,
        user_registration: UserRegistration,
    ) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}Expand description
A UserRegistrationRepository helps interacting with UserRegistration
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<UserRegistration>, 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<UserRegistration>, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Lookup a UserRegistration by its ID
Returns None if no UserRegistration was found
§Parameters
- id: The ID of the- UserRegistrationto lookup
§Errors
Returns Self::Error if the underlying repository fails
Sourcefn add<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    rng: &'life1 mut (dyn RngCore + Send),
    clock: &'life2 dyn Clock,
    username: String,
    ip_address: Option<IpAddr>,
    user_agent: Option<String>,
    post_auth_action: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
 
fn add<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 mut self,
    rng: &'life1 mut (dyn RngCore + Send),
    clock: &'life2 dyn Clock,
    username: String,
    ip_address: Option<IpAddr>,
    user_agent: Option<String>,
    post_auth_action: Option<Value>,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
Create a new UserRegistration session
Returns the newly created UserRegistration
§Parameters
- rng: The random number generator to use
- clock: The clock used to generate timestamps
- username: The username of the user
- ip_address: The IP address of the user agent, if any
- user_agent: The user agent of the user agent, if any
- post_auth_action: The post auth action to execute after the registration, if any
§Errors
Returns Self::Error if the underlying repository fails
Sourcefn set_display_name<'life0, 'async_trait>(
    &'life0 mut self,
    user_registration: UserRegistration,
    display_name: String,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn set_display_name<'life0, 'async_trait>(
    &'life0 mut self,
    user_registration: UserRegistration,
    display_name: String,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Set the display name of a UserRegistration
Returns the updated UserRegistration
§Parameters
- user_registration: The- UserRegistrationto update
- display_name: The display name to set
§Errors
Returns Self::Error if the underlying repository fails or if the
registration is already completed
Sourcefn set_terms_url<'life0, 'async_trait>(
    &'life0 mut self,
    user_registration: UserRegistration,
    terms_url: Url,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn set_terms_url<'life0, 'async_trait>(
    &'life0 mut self,
    user_registration: UserRegistration,
    terms_url: Url,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Set the terms URL of a UserRegistration
Returns the updated UserRegistration
§Parameters
- user_registration: The- UserRegistrationto update
- terms_url: The terms URL to set
§Errors
Returns Self::Error if the underlying repository fails or if the
registration is already completed
Sourcefn set_email_authentication<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    user_registration: UserRegistration,
    email_authentication: &'life1 UserEmailAuthentication,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn set_email_authentication<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    user_registration: UserRegistration,
    email_authentication: &'life1 UserEmailAuthentication,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Set the email authentication code of a UserRegistration
Returns the updated UserRegistration
§Parameters
- user_registration: The- UserRegistrationto update
- email_authentication: The- UserEmailAuthenticationto set
§Errors
Returns Self::Error if the underlying repository fails or if the
registration is already completed
Sourcefn set_password<'life0, 'async_trait>(
    &'life0 mut self,
    user_registration: UserRegistration,
    hashed_password: String,
    version: u16,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
 
fn set_password<'life0, 'async_trait>(
    &'life0 mut self,
    user_registration: UserRegistration,
    hashed_password: String,
    version: u16,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
Set the password of a UserRegistration
Returns the updated UserRegistration
§Parameters
- user_registration: The- UserRegistrationto update
- hashed_password: The hashed password to set
- version: The version of the hashing scheme
§Errors
Returns Self::Error if the underlying repository fails or if the
registration is already completed
Sourcefn complete<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    clock: &'life1 dyn Clock,
    user_registration: UserRegistration,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
 
fn complete<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    clock: &'life1 dyn Clock,
    user_registration: UserRegistration,
) -> Pin<Box<dyn Future<Output = Result<UserRegistration, Self::Error>> + Send + 'async_trait>>where
    Self: 'async_trait,
    'life0: 'async_trait,
    'life1: 'async_trait,
Complete a UserRegistration
Returns the updated UserRegistration
§Parameters
- clock: The clock used to generate timestamps
- user_registration: The- UserRegistrationto complete
§Errors
Returns Self::Error if the underlying repository fails or if the
registration is already completed