Trait CardService

Source
pub trait CardService: Service {
    // Required methods
    fn get_card<'life0, 'async_trait>(
        &'life0 self,
        id: CardId,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Card>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_cards<'life0, 'async_trait>(
        &'life0 self,
        pagination: Option<PaginationParams>,
        filters: Option<CardFilterParams>,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<Card>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_card<'life0, 'async_trait>(
        &'life0 self,
        card: Card,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Card>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_card<'life0, 'async_trait>(
        &'life0 self,
        id: CardId,
        card: Card,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Card>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_card<'life0, 'async_trait>(
        &'life0 self,
        id: CardId,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn archive_card<'life0, 'async_trait>(
        &'life0 self,
        id: CardId,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn unarchive_card<'life0, 'async_trait>(
        &'life0 self,
        id: CardId,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn copy_card<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: CardId,
        new_name: &'life1 str,
        collection_id: Option<i32>,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Card>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn validate_card<'life0, 'life1, 'async_trait>(
        &'life0 self,
        card: &'life1 Card,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn execute_card_query<'life0, 'async_trait>(
        &'life0 self,
        id: CardId,
        parameters: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<QueryResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn export_card_query<'life0, 'async_trait>(
        &'life0 self,
        id: CardId,
        format: ExportFormat,
        parameters: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn execute_card_pivot_query<'life0, 'async_trait>(
        &'life0 self,
        id: CardId,
        parameters: Option<Value>,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<QueryResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Service trait for Card operations

Required Methods§

Source

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

Get a card by ID

Source

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

List cards with filters

Source

fn create_card<'life0, 'async_trait>( &'life0 self, card: Card, ) -> Pin<Box<dyn Future<Output = ServiceResult<Card>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create a new card with validation

Source

fn update_card<'life0, 'async_trait>( &'life0 self, id: CardId, card: Card, ) -> Pin<Box<dyn Future<Output = ServiceResult<Card>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Update a card with business rule validation

Source

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

Delete a card with cascade checks

Source

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

Archive a card

Source

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

Unarchive a card

Source

fn copy_card<'life0, 'life1, 'async_trait>( &'life0 self, id: CardId, new_name: &'life1 str, collection_id: Option<i32>, ) -> Pin<Box<dyn Future<Output = ServiceResult<Card>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Copy a card to a new collection

Source

fn validate_card<'life0, 'life1, 'async_trait>( &'life0 self, card: &'life1 Card, ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Validate card data

Source

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

Execute a card’s query

Source

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

Export card query results

Source

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

Execute a pivot query for a card

Implementors§