Skip to main content

ResourceStore

Trait ResourceStore 

Source
pub trait ResourceStore: Send + Sync {
    // Required methods
    fn resource_name(&self) -> &str;
    fn find_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<ResourceRow, ShaperailError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_all<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
        &'life0 self,
        endpoint: &'life1 EndpointSpec,
        filters: &'life2 FilterSet,
        search: Option<&'life3 SearchParam>,
        sort: &'life4 SortParam,
        page: &'life5 PageRequest,
    ) -> Pin<Box<dyn Future<Output = Result<(Vec<ResourceRow>, Value), ShaperailError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait,
             'life4: 'async_trait,
             'life5: 'async_trait;
    fn insert<'life0, 'life1, 'async_trait>(
        &'life0 self,
        data: &'life1 Map<String, Value>,
    ) -> Pin<Box<dyn Future<Output = Result<ResourceRow, ShaperailError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_by_id<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 Uuid,
        data: &'life2 Map<String, Value>,
    ) -> Pin<Box<dyn Future<Output = Result<ResourceRow, ShaperailError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn soft_delete_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<ResourceRow, ShaperailError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn hard_delete_by_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 Uuid,
    ) -> Pin<Box<dyn Future<Output = Result<ResourceRow, ShaperailError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Typed resource store implemented by generated per-resource query modules or OrmBackedStore (M14).

Required Methods§

Source

fn resource_name(&self) -> &str

Source

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

Source

fn find_all<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( &'life0 self, endpoint: &'life1 EndpointSpec, filters: &'life2 FilterSet, search: Option<&'life3 SearchParam>, sort: &'life4 SortParam, page: &'life5 PageRequest, ) -> Pin<Box<dyn Future<Output = Result<(Vec<ResourceRow>, Value), ShaperailError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Source

fn insert<'life0, 'life1, 'async_trait>( &'life0 self, data: &'life1 Map<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<ResourceRow, ShaperailError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_by_id<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 Uuid, data: &'life2 Map<String, Value>, ) -> Pin<Box<dyn Future<Output = Result<ResourceRow, ShaperailError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn soft_delete_by_id<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 Uuid, ) -> Pin<Box<dyn Future<Output = Result<ResourceRow, ShaperailError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn hard_delete_by_id<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 Uuid, ) -> Pin<Box<dyn Future<Output = Result<ResourceRow, ShaperailError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§