Trait CardRepository

Source
pub trait CardRepository:
    Repository<Entity = Card, Id = CardId>
    + Send
    + Sync {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn list_with_filters<'life0, 'async_trait>(
        &'life0 self,
        pagination: Option<PaginationParams>,
        filters: Option<CardFilterParams>,
    ) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Card>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_by_collection<'life0, 'async_trait>(
        &'life0 self,
        collection_id: i32,
    ) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Card>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Card>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn archive<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 CardId,
    ) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn unarchive<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 CardId,
    ) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn copy<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        id: &'life1 CardId,
        new_name: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = RepositoryResult<Card>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn execute_query<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 CardId,
        parameters: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn export_query<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 CardId,
        format: ExportFormat,
        parameters: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn execute_pivot_query<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 CardId,
        parameters: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Repository trait for Card entities

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Cast to Any for type checking in tests

Source

fn list_with_filters<'life0, 'async_trait>( &'life0 self, pagination: Option<PaginationParams>, filters: Option<CardFilterParams>, ) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Card>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List cards with card-specific filters

Source

fn get_by_collection<'life0, 'async_trait>( &'life0 self, collection_id: i32, ) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Card>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get cards in a specific collection

Source

fn search<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, ) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Card>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Search cards by query

Source

fn archive<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 CardId, ) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Archive a card

Source

fn unarchive<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 CardId, ) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Unarchive a card

Source

fn copy<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, id: &'life1 CardId, new_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = RepositoryResult<Card>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Copy a card

Source

fn execute_query<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 CardId, parameters: Option<Value>, ) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a card’s query

Source

fn export_query<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 CardId, format: ExportFormat, parameters: Option<Value>, ) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Export card query results

Source

fn execute_pivot_query<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 CardId, parameters: Option<Value>, ) -> Pin<Box<dyn Future<Output = RepositoryResult<QueryResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a pivot query for a card

Implementors§