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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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_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
Sourcefn 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 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
Sourcefn 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,
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