Trait db_core::SCDatabase

source ·
pub trait SCDatabase: Send + Sync + CloneSPDatabase {
Show 28 methods fn ping<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn create_forge_instance<'life0, 'life1, 'async_trait>(
        &'life0 self,
        f: &'life1 CreateForge<'_>
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn get_forge<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<Forge>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn delete_forge_instance<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn forge_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<bool>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn forge_type_exists<'life0, 'life1, 'async_trait>(
        &'life0 self,
        forge_type: &'life1 ForgeImplementation
    ) -> Pin<Box<dyn Future<Output = DBResult<bool>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn get_all_forges<'life0, 'async_trait>(
        &'life0 self,
        with_imports: bool,
        offset: u32,
        limit: u32
    ) -> Pin<Box<dyn Future<Output = DBResult<Vec<Forge>>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn add_user<'life0, 'life1, 'async_trait>(
        &'life0 self,
        u: &'life1 AddUser<'_>
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn get_user<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        url: &'life2 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<User>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait
; fn user_exists<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        url: Option<&'life2 Url>
    ) -> Pin<Box<dyn Future<Output = DBResult<bool>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait
; fn delete_user<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        username: &'life1 str,
        url: &'life2 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait
; fn delete_repository<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        owner: &'life1 str,
        name: &'life2 str,
        url: &'life3 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait
; fn repository_exists<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        owner: &'life2 str,
        url: &'life3 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<bool>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait
; fn get_all_repositories<'life0, 'async_trait>(
        &'life0 self,
        offset: u32,
        limit: u32
    ) -> Pin<Box<dyn Future<Output = DBResult<Vec<Repository>>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn create_repository<'life0, 'life1, 'async_trait>(
        &'life0 self,
        r: &'life1 AddRepository<'_>
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn search_repository<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 str
    ) -> Pin<Box<dyn Future<Output = DBResult<Vec<Repository>>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn add_starchart_to_introducer<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn get_all_introduced_starchart_instances<'life0, 'async_trait>(
        &'life0 self,
        offset: u32,
        limit: u32
    ) -> Pin<Box<dyn Future<Output = DBResult<Vec<Starchart>>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn add_word_to_mini_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        word: &'life1 str
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn rm_word_from_mini_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        word: &'life1 str
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn is_word_mini_indexed<'life0, 'life1, 'async_trait>(
        &'life0 self,
        word: &'life1 str
    ) -> Pin<Box<dyn Future<Output = DBResult<bool>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn export_mini_index<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = DBResult<String>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait
; fn import_mini_index<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        starchart_instance_url: &'life1 Url,
        mini_index: &'life2 str
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait
; fn rm_imported_mini_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        starchart_instance_url: &'life1 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn search_mini_index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 str
    ) -> Pin<Box<dyn Future<Output = DBResult<Vec<String>>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn record_starchart_imports<'life0, 'life1, 'async_trait>(
        &'life0 self,
        starchart_url: &'life1 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn rm_starchart_import<'life0, 'life1, 'async_trait>(
        &'life0 self,
        starchart_url: &'life1 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<()>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
; fn is_starchart_imported<'life0, 'life1, 'async_trait>(
        &'life0 self,
        starchart_url: &'life1 Url
    ) -> Pin<Box<dyn Future<Output = DBResult<bool>> + Send + 'async_trait>>
    where
        Self: 'async_trait,
        'life0: 'async_trait,
        'life1: 'async_trait
;
}
Expand description

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

Required Methods§

ping DB

create forge instance

get forge instance data

delete forge instance

check if a forge instance exists

check if forge type exists

Get all forges

add new user to database

get user data

check if an user exists. When url of a forge instance is provided, username search is done only on that forge

delete user

delete repository

check if a repository exists.

Get all repositories

add new repository to database.

Search all repositories

Add Starchart instance to introducer

Get all introduced Starchart instances

Add word to mini index

Remove word from mini index

Check if word exists in mini index

consolidate and export mini index

Import mini-index

Delete imported mini-index

Search mini index

Mark a Starchart instance as imported

Unmark a Starchart instance as imported

Check if Starchart instance is imported

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Implementors§