pub struct MockCollectionRepository { /* private fields */ }
Expand description
Mock implementation of CollectionRepository for testing
Implementations§
Source§impl MockCollectionRepository
impl MockCollectionRepository
Sourcepub fn set_should_fail(&mut self, should_fail: bool)
pub fn set_should_fail(&mut self, should_fail: bool)
Set whether operations should fail
Sourcepub async fn add_collection(&self, collection: Collection)
pub async fn add_collection(&self, collection: Collection)
Add a collection to the mock repository
Trait Implementations§
Source§impl CollectionRepository for MockCollectionRepository
impl CollectionRepository for MockCollectionRepository
Source§fn list_with_filters<'life0, 'async_trait>(
&'life0 self,
pagination: Option<PaginationParams>,
filters: Option<CollectionFilterParams>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Collection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_with_filters<'life0, 'async_trait>(
&'life0 self,
pagination: Option<PaginationParams>,
filters: Option<CollectionFilterParams>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Collection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List collections with collection-specific filters
Source§fn get_children<'life0, 'async_trait>(
&'life0 self,
parent_id: CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Collection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_children<'life0, 'async_trait>(
&'life0 self,
parent_id: CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Collection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get child collections of a specific collection
Source§fn get_root_collections<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = RepositoryResult<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 = RepositoryResult<Vec<Collection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get root collections
Source§fn get_by_parent<'life0, 'async_trait>(
&'life0 self,
parent_id: Option<CollectionId>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Collection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_by_parent<'life0, 'async_trait>(
&'life0 self,
parent_id: Option<CollectionId>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Collection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get collections by parent ID
Source§fn get_permissions<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_permissions<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get collection permissions
Source§fn update_permissions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
_permissions: &'life2 Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_permissions<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
_permissions: &'life2 Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update collection permissions
Source§fn move_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
new_parent_id: Option<CollectionId>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Collection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn move_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
new_parent_id: Option<CollectionId>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Collection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Move collection to another parent
Source§fn archive<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn archive<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Archive a collection
Source§fn unarchive<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
) -> 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 CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unarchive a collection
Source§impl Default for MockCollectionRepository
impl Default for MockCollectionRepository
Source§impl Repository for MockCollectionRepository
impl Repository for MockCollectionRepository
Source§type Entity = Collection
type Entity = Collection
The entity type this repository manages
Source§type Id = CollectionId
type Id = CollectionId
The ID type for entities
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Collection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Collection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get an entity by ID
Source§fn list<'life0, 'async_trait>(
&'life0 self,
_pagination: Option<PaginationParams>,
_filters: Option<FilterParams>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Collection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list<'life0, 'async_trait>(
&'life0 self,
_pagination: Option<PaginationParams>,
_filters: Option<FilterParams>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Collection>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List entities with optional pagination and filters
Source§fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
entity: &'life1 Collection,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Collection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
entity: &'life1 Collection,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Collection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a new entity
Source§fn update<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
entity: &'life2 Collection,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Collection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
entity: &'life2 Collection,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Collection>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update an existing entity
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CollectionId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delete an entity
Auto Trait Implementations§
impl Freeze for MockCollectionRepository
impl !RefUnwindSafe for MockCollectionRepository
impl Send for MockCollectionRepository
impl Sync for MockCollectionRepository
impl Unpin for MockCollectionRepository
impl !UnwindSafe for MockCollectionRepository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more