Trait BuildingRepository

Source
pub trait BuildingRepository: Send + Sync {
    // Required methods
    fn create<'life0, 'life1, 'async_trait>(
        &'life0 self,
        building: &'life1 Building,
    ) -> Pin<Box<dyn Future<Output = Result<Building, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_by_id<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Building>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_all<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Building>, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn find_all_paginated<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        page_request: &'life1 PageRequest,
        filters: &'life2 BuildingFilters,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<Building>, i64), String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn update<'life0, 'life1, 'async_trait>(
        &'life0 self,
        building: &'life1 Building,
    ) -> Pin<Box<dyn Future<Output = Result<Building, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
        id: Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Port (interface) pour le repository de bâtiments

Required Methods§

Source

fn create<'life0, 'life1, 'async_trait>( &'life0 self, building: &'life1 Building, ) -> Pin<Box<dyn Future<Output = Result<Building, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn find_by_id<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<Option<Building>, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

fn find_all_paginated<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, page_request: &'life1 PageRequest, filters: &'life2 BuildingFilters, ) -> Pin<Box<dyn Future<Output = Result<(Vec<Building>, i64), String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Find all buildings with pagination and filters Returns tuple of (buildings, total_count)

Source

fn update<'life0, 'life1, 'async_trait>( &'life0 self, building: &'life1 Building, ) -> Pin<Box<dyn Future<Output = Result<Building, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn delete<'life0, 'async_trait>( &'life0 self, id: Uuid, ) -> Pin<Box<dyn Future<Output = Result<bool, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§