Trait CollectionService

Source
pub trait CollectionService: Service {
    // Required methods
    fn get_collection<'life0, 'async_trait>(
        &'life0 self,
        id: CollectionId,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Collection>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn list_collections<'life0, 'async_trait>(
        &'life0 self,
        pagination: Option<PaginationParams>,
        filters: Option<CollectionFilterParams>,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<Collection>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_collection<'life0, 'async_trait>(
        &'life0 self,
        collection: Collection,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Collection>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn update_collection<'life0, 'async_trait>(
        &'life0 self,
        id: CollectionId,
        collection: Collection,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Collection>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn delete_collection<'life0, 'async_trait>(
        &'life0 self,
        id: CollectionId,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn archive_collection<'life0, 'async_trait>(
        &'life0 self,
        id: CollectionId,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn unarchive_collection<'life0, 'async_trait>(
        &'life0 self,
        id: CollectionId,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn move_collection<'life0, 'async_trait>(
        &'life0 self,
        id: CollectionId,
        new_parent_id: Option<CollectionId>,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Collection>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_root_collections<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<Collection>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_collections_by_parent<'life0, 'async_trait>(
        &'life0 self,
        parent_id: CollectionId,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<Collection>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn validate_collection<'life0, 'life1, 'async_trait>(
        &'life0 self,
        collection: &'life1 Collection,
    ) -> Pin<Box<dyn Future<Output = ServiceResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Service trait for Collection operations

Required Methods§

Source

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

Get a collection by ID

Source

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

List collections with filters

Source

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

Create a new collection

Source

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

Update a collection

Source

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

Delete a collection

Source

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

Archive a collection

Source

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

Unarchive a collection

Source

fn move_collection<'life0, 'async_trait>( &'life0 self, id: CollectionId, new_parent_id: Option<CollectionId>, ) -> Pin<Box<dyn Future<Output = ServiceResult<Collection>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Move a collection to a new parent

Source

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

Get root collections

Source

fn get_collections_by_parent<'life0, 'async_trait>( &'life0 self, parent_id: CollectionId, ) -> Pin<Box<dyn Future<Output = ServiceResult<Vec<Collection>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get collections by parent

Source

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

Validate collection data

Implementors§