CrudRepository

Trait CrudRepository 

Source
pub trait CrudRepository<T, ID, DB> {
    // Required methods
    fn find_all<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, RepositoryError<DB>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_one<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 ID,
    ) -> Pin<Box<dyn Future<Output = Result<Option<T>, RepositoryError<DB>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn insert_one<'life0, 'life1, 'async_trait>(
        &'life0 self,
        entity: &'life1 T,
    ) -> Pin<Box<dyn Future<Output = Result<ID, RepositoryError<DB>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_one<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 ID,
        entity: &'life2 T,
    ) -> Pin<Box<dyn Future<Output = Result<Option<T>, RepositoryError<DB>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete_one<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 ID,
    ) -> Pin<Box<dyn Future<Output = Result<u64, RepositoryError<DB>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

Source

fn find_all<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, RepositoryError<DB>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn find_one<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ID, ) -> Pin<Box<dyn Future<Output = Result<Option<T>, RepositoryError<DB>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn insert_one<'life0, 'life1, 'async_trait>( &'life0 self, entity: &'life1 T, ) -> Pin<Box<dyn Future<Output = Result<ID, RepositoryError<DB>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_one<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 ID, entity: &'life2 T, ) -> Pin<Box<dyn Future<Output = Result<Option<T>, RepositoryError<DB>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn delete_one<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 ID, ) -> Pin<Box<dyn Future<Output = Result<u64, RepositoryError<DB>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§