revolt_database/models/accounts/
ops.rs1use revolt_result::Result;
2
3use crate::Account;
4
5#[cfg(feature = "mongodb")]
6mod mongodb;
7mod reference;
8
9#[async_trait]
10pub trait AbstractAccounts: Sync + Send {
11 async fn fetch_account(&self, id: &str) -> Result<Account>;
13
14 async fn fetch_account_by_normalised_email(
16 &self,
17 normalised_email: &str,
18 ) -> Result<Option<Account>>;
19
20 async fn fetch_account_with_email_verification(&self, token: &str) -> Result<Account>;
22
23 async fn fetch_account_with_password_reset(&self, token: &str) -> Result<Account>;
25
26 async fn fetch_account_with_deletion_token(&self, token: &str) -> Result<Account>;
28
29 async fn fetch_accounts_due_for_deletion(&self) -> Result<Vec<Account>>;
31
32 async fn save_account(&self, account: &Account) -> Result<()>;
34}