pub trait UsernameWriter: UsernameReader {
// Required methods
fn set_username<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
wallet: &'life1 str,
username: &'life2 str,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(UsernameRecord, Option<String>), UsernameWriteError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn delete_username<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<UsernameRecord>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Write operations for usernames.
Required Methods§
Sourcefn set_username<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
wallet: &'life1 str,
username: &'life2 str,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(UsernameRecord, Option<String>), UsernameWriteError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set_username<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
wallet: &'life1 str,
username: &'life2 str,
now: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = Result<(UsernameRecord, Option<String>), UsernameWriteError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Set (insert or update) the username for a wallet.
Returns the final row and the previous username (if any) on success.
Returns UsernameWriteError::UniqueViolation when the username is taken.
Sourcefn delete_username<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<UsernameRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_username<'life0, 'life1, 'async_trait>(
&'life0 self,
wallet: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<UsernameRecord>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete the username for a wallet. Returns the deleted row if one existed.