pub struct MockDashboardRepository { /* private fields */ }
Expand description
Mock implementation of DashboardRepository for testing
Implementations§
Source§impl MockDashboardRepository
impl MockDashboardRepository
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_dashboard(&self, dashboard: Dashboard)
pub async fn add_dashboard(&self, dashboard: Dashboard)
Add a dashboard to the mock repository
Trait Implementations§
Source§impl DashboardRepository for MockDashboardRepository
impl DashboardRepository for MockDashboardRepository
Source§fn list_with_filters<'life0, 'async_trait>(
&'life0 self,
pagination: Option<PaginationParams>,
filters: Option<DashboardFilterParams>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Dashboard>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_with_filters<'life0, 'async_trait>(
&'life0 self,
pagination: Option<PaginationParams>,
filters: Option<DashboardFilterParams>,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Dashboard>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List dashboards with dashboard-specific filters
Source§fn get_by_collection<'life0, 'async_trait>(
&'life0 self,
collection_id: i32,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Dashboard>>> + 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<Dashboard>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get dashboards in a specific collection
Source§fn get_cards<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_cards<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Vec<Value>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get dashboard cards (visualizations on the dashboard)
Source§fn add_card<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
card_data: &'life2 Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_card<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
card_data: &'life2 Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Add a card to a dashboard
Source§fn remove_card<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
card_id: i32,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_card<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
card_id: i32,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a card from a dashboard
Source§fn update_card<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
card_id: i32,
updates: &'life2 Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn update_card<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
card_id: i32,
updates: &'life2 Value,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update card position/size on dashboard
Source§fn duplicate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
new_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Dashboard>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn duplicate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
new_name: &'life2 str,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Dashboard>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Duplicate a dashboard
Source§fn archive<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
) -> 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 DashboardId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Archive a dashboard
Source§fn unarchive<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
) -> 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 DashboardId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unarchive a dashboard
Source§fn favorite<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn favorite<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Favorite a dashboard
Source§fn unfavorite<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unfavorite<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unfavorite a dashboard
Source§impl Default for MockDashboardRepository
impl Default for MockDashboardRepository
Source§impl Repository for MockDashboardRepository
impl Repository for MockDashboardRepository
Source§type Id = DashboardId
type Id = DashboardId
The ID type for entities
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Dashboard>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 DashboardId,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Dashboard>> + 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<Dashboard>>> + 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<Dashboard>>> + 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 Dashboard,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Dashboard>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create<'life0, 'life1, 'async_trait>(
&'life0 self,
entity: &'life1 Dashboard,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Dashboard>> + 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 DashboardId,
entity: &'life2 Dashboard,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Dashboard>> + 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 DashboardId,
entity: &'life2 Dashboard,
) -> Pin<Box<dyn Future<Output = RepositoryResult<Dashboard>> + 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 DashboardId,
) -> 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 DashboardId,
) -> 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 MockDashboardRepository
impl !RefUnwindSafe for MockDashboardRepository
impl Send for MockDashboardRepository
impl Sync for MockDashboardRepository
impl Unpin for MockDashboardRepository
impl !UnwindSafe for MockDashboardRepository
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