pub trait MCDatabase: Send + Sync + CloneSPDatabase {
Show 35 methods fn ping<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn register<'life0, 'life1, 'async_trait>(
        &'life0 self,
        p: &'life1 Register<'_>
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn delete_user<'life0, 'life1, 'async_trait>(
        &'life0 self,
        username: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn username_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        username: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<bool, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn get_email<'life0, 'life1, 'async_trait>(
        &'life0 self,
        username: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Option<String>, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn email_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        email: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<bool, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn update_email<'life0, 'life1, 'async_trait>(
        &'life0 self,
        p: &'life1 UpdateEmail<'_>
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn get_password<'life0, 'life1, 'async_trait>(
        &'life0 self,
        l: &'life1 Login<'_>
    ) -> Pin<Box<dyn Future<Output = Result<NameHash, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn update_password<'life0, 'life1, 'async_trait>(
        &'life0 self,
        p: &'life1 NameHash
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn update_username<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        current: &'life1 str,
        new: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn get_secret<'life0, 'life1, 'async_trait>(
        &'life0 self,
        username: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Secret, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn update_secret<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        secret: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn create_captcha<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        p: &'life2 CreateCaptcha<'_>
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn get_captcha_config<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<Captcha, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn get_all_user_captchas<'life0, 'life1, 'async_trait>(
        &'life0 self,
        username: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Captcha, Global>, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn update_captcha_metadata<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        p: &'life2 CreateCaptcha<'_>
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn update_captcha_key<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        old_key: &'life2 str,
        new_key: &'life3 str
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: 'async_trait
; fn add_captcha_levels<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        captcha_key: &'life2 str,
        levels: &'life3 [Level]
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: 'async_trait
; fn captcha_exists<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: Option<&'life1 str>,
        captcha_key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<bool, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn delete_captcha_levels<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        captcha_key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn delete_captcha<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        captcha_key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn get_captcha_levels<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: Option<&'life1 str>,
        captcha_key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Level, Global>, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn get_captcha_cooldown<'life0, 'life1, 'async_trait>(
        &'life0 self,
        captcha_key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<i32, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn add_traffic_pattern<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        captcha_key: &'life2 str,
        pattern: &'life3 TrafficPattern
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: 'async_trait
; fn get_traffic_pattern<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        captcha_key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<TrafficPattern, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn delete_traffic_pattern<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        captcha_key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn create_notification<'life0, 'life1, 'async_trait>(
        &'life0 self,
        p: &'life1 AddNotification<'_>
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn get_all_unread_notifications<'life0, 'life1, 'async_trait>(
        &'life0 self,
        username: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Notification, Global>, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn mark_notification_read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        id: i32
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn record_fetch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn record_solve<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn record_confirm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<(), DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn fetch_config_fetched<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user: &'life1 str,
        key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<i64, Global>, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn fetch_solve<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user: &'life1 str,
        key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<i64, Global>, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn fetch_confirm<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        user: &'life1 str,
        key: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<i64, Global>, DBError>> + Send + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
;
}
Expand description

mCaptcha’s database requirements. To implement support for $Database, kindly implement this trait.

Required methods

ping DB

register a new user

delete a user

check if username exists

get user email

check if email exists

update a user’s email

get a user’s password

update user’s password

update username

get a user’s secret

update a user’s secret

create new captcha

Get captcha config

Get all captchas belonging to user

update captcha metadata; doesn’t change captcha key

update captcha key; doesn’t change metadata

Add levels to captcha

check if captcha exists

Delete all levels of a captcha

Delete captcha

Get captcha levels

Get captcha’s cooldown period

Add traffic configuration

Get traffic configuration

Delete traffic configuration

create new notification

get all unread notifications

mark a notification read

record PoWConfig fetches

record PoWConfig solves

record PoWConfig confirms

featch PoWConfig fetches

featch PoWConfig solves

featch PoWConfig confirms

Implementors