pub trait AccountRepo: Send + Sync {
// Required method
fn create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
username: &'life1 str,
root_pubkey: &'life2 str,
root_kid: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<CreatedAccount, AccountRepoError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}Expand description
Repository trait for account operations
This trait abstracts database operations to enable unit testing handlers with mock implementations.
Required Methods§
Sourcefn create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
username: &'life1 str,
root_pubkey: &'life2 str,
root_kid: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<CreatedAccount, AccountRepoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
username: &'life1 str,
root_pubkey: &'life2 str,
root_kid: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<CreatedAccount, AccountRepoError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Create a new account with the given credentials
§Errors
Returns AccountRepoError::DuplicateUsername if username is taken.
Returns AccountRepoError::DuplicateKey if public key is already registered.