pub trait Repository<T: BaseDocument + Debug + Serialize + for<'de> Deserialize<'de>> {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        entity: T,
        ctx: Option<&'life1 Context>
    ) -> Pin<Box<dyn Future<Output = Result<ObjectId, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn save_many<'life0, 'life1, 'async_trait>(
        &'life0 self,
        entities: Vec<T>,
        ctx: Option<&'life1 Context>
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectId>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_all_pageable<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: PageableRequest,
        ctx: Option<&'life1 Context>
    ) -> Pin<Box<dyn Future<Output = Result<PageableResponse<T>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn count_documents_in_collection<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ctx: Option<&'life1 Context>
    ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_by_id<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        ctx: Option<&'life2 Context>
    ) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn find_by_raw_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: ObjectId,
        ctx: Option<&'life1 Context>
    ) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_by_ids<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ids: Vec<String>,
        ctx: Option<&'life1 Context>
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_by_raw_ids<'life0, 'life1, 'async_trait>(
        &'life0 self,
        pids: Vec<ObjectId>,
        ctx: Option<&'life1 Context>
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_by_filter_and_options<'life0, 'life1, 'async_trait>(
        &'life0 self,
        filter: Document,
        options: Option<FindOneOptions>,
        ctx: Option<&'life1 Context>
    ) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn find_all_by_filter_and_options<'life0, 'life1, 'async_trait>(
        &'life0 self,
        filter: Document,
        options: Option<FindOptions>,
        ctx: Option<&'life1 Context>
    ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        entity: &'life1 T,
        ctx: Option<&'life2 Context>
    ) -> Pin<Box<dyn Future<Output = Result<ObjectId, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        pid: String,
        ctx: Option<&'life1 Context>
    ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}

Required Methods§

source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, entity: T, ctx: Option<&'life1 Context> ) -> Pin<Box<dyn Future<Output = Result<ObjectId, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn save_many<'life0, 'life1, 'async_trait>( &'life0 self, entities: Vec<T>, ctx: Option<&'life1 Context> ) -> Pin<Box<dyn Future<Output = Result<Vec<ObjectId>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn get_all_pageable<'life0, 'life1, 'async_trait>( &'life0 self, request: PageableRequest, ctx: Option<&'life1 Context> ) -> Pin<Box<dyn Future<Output = Result<PageableResponse<T>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn count_documents_in_collection<'life0, 'life1, 'async_trait>( &'life0 self, ctx: Option<&'life1 Context> ) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn find_by_id<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 str, ctx: Option<&'life2 Context> ) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source

fn find_by_raw_id<'life0, 'life1, 'async_trait>( &'life0 self, id: ObjectId, ctx: Option<&'life1 Context> ) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn find_by_ids<'life0, 'life1, 'async_trait>( &'life0 self, ids: Vec<String>, ctx: Option<&'life1 Context> ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn find_by_raw_ids<'life0, 'life1, 'async_trait>( &'life0 self, pids: Vec<ObjectId>, ctx: Option<&'life1 Context> ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn find_by_filter_and_options<'life0, 'life1, 'async_trait>( &'life0 self, filter: Document, options: Option<FindOneOptions>, ctx: Option<&'life1 Context> ) -> Pin<Box<dyn Future<Output = Result<T, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn find_all_by_filter_and_options<'life0, 'life1, 'async_trait>( &'life0 self, filter: Document, options: Option<FindOptions>, ctx: Option<&'life1 Context> ) -> Pin<Box<dyn Future<Output = Result<Vec<T>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source

fn update<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, entity: &'life1 T, ctx: Option<&'life2 Context> ) -> Pin<Box<dyn Future<Output = Result<ObjectId, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

source

fn delete<'life0, 'life1, 'async_trait>( &'life0 self, pid: String, ctx: Option<&'life1 Context> ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§