Skip to main content

FetchFromDatabase

Trait FetchFromDatabase 

Source
pub trait FetchFromDatabase: Send + Sync {
    // Required methods
    fn get<'life0, 'life1, 'async_trait, E>(
        &'life0 self,
        id: &'life1 E::PrimaryKey,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Option<Arc<E>>>> + Send + 'async_trait>>
       where E: 'static + Entity + Clone + Send + Sync + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn count<'life0, 'async_trait, E>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<u32>> + Send + 'async_trait>>
       where E: 'static + Entity + Clone + Send + Sync + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn load_all<'life0, 'async_trait, E>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<Arc<E>>>> + Send + 'async_trait>>
       where E: 'static + Entity + Clone + Send + Sync + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn get_borrowed<'life0, 'life1, 'async_trait, E>(
        &'life0 self,
        id: &'life1 <E as BorrowPrimaryKey>::BorrowedPrimaryKey,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Option<Arc<E>>>> + Send + 'async_trait>>
       where E: 'static + EntityGetBorrowed + Clone + Send + Sync + 'async_trait,
             E::PrimaryKey: Borrow<E::BorrowedPrimaryKey>,
             <E as BorrowPrimaryKey>::BorrowedPrimaryKey: Send + Sync,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn search<'life0, 'life1, 'async_trait, E, SearchKey>(
        &'life0 self,
        search_key: &'life1 SearchKey,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<Arc<E>>>> + Send + 'async_trait>>
       where E: 'static + Entity + SearchableEntity<SearchKey> + Clone + Send + Sync + 'async_trait,
             SearchKey: Send + Sync + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn get_unique<'a, 'life0, 'async_trait, U>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Option<Arc<U>>>> + Send + 'async_trait>>
       where U: 'static + UniqueEntityExt + Entity + Clone + Send + Sync + 'async_trait,
             Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait { ... }
    fn exists<'a, 'life0, 'async_trait, U>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<bool>> + Send + 'async_trait>>
       where U: 'static + UniqueEntityExt + Entity + Clone + Send + Sync + 'async_trait,
             Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Interface to immutably access the database either from the connection directly or through a transaction.

Required Methods§

Source

fn get<'life0, 'life1, 'async_trait, E>( &'life0 self, id: &'life1 E::PrimaryKey, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Option<Arc<E>>>> + Send + 'async_trait>>
where E: 'static + Entity + Clone + Send + Sync + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get an instance of E from the database by its primary key.

Source

fn count<'life0, 'async_trait, E>( &'life0 self, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<u32>> + Send + 'async_trait>>
where E: 'static + Entity + Clone + Send + Sync + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Count the number of Es in the database.

Source

fn load_all<'life0, 'async_trait, E>( &'life0 self, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<Arc<E>>>> + Send + 'async_trait>>
where E: 'static + Entity + Clone + Send + Sync + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Load all Es from the database.

Source

fn get_borrowed<'life0, 'life1, 'async_trait, E>( &'life0 self, id: &'life1 <E as BorrowPrimaryKey>::BorrowedPrimaryKey, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Option<Arc<E>>>> + Send + 'async_trait>>
where E: 'static + EntityGetBorrowed + Clone + Send + Sync + 'async_trait, E::PrimaryKey: Borrow<E::BorrowedPrimaryKey>, <E as BorrowPrimaryKey>::BorrowedPrimaryKey: Send + Sync, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get an instance of E from the database by the borrowed form of its primary key.

Source

fn search<'life0, 'life1, 'async_trait, E, SearchKey>( &'life0 self, search_key: &'life1 SearchKey, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Vec<Arc<E>>>> + Send + 'async_trait>>
where E: 'static + Entity + SearchableEntity<SearchKey> + Clone + Send + Sync + 'async_trait, SearchKey: Send + Sync + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Search for relevant instances of E given a search key.

Provided Methods§

Source

fn get_unique<'a, 'life0, 'async_trait, U>( &'life0 self, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<Option<Arc<U>>>> + Send + 'async_trait>>
where U: 'static + UniqueEntityExt + Entity + Clone + Send + Sync + 'async_trait, Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Get the requested unique entity from the database.

Source

fn exists<'a, 'life0, 'async_trait, U>( &'life0 self, ) -> Pin<Box<dyn Future<Output = CryptoKeystoreResult<bool>> + Send + 'async_trait>>
where U: 'static + UniqueEntityExt + Entity + Clone + Send + Sync + 'async_trait, Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Determine whether a unique entity is present in the database.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§