pub trait DrawingToolsRepository {
// Required methods
fn get_all_categories(&self) -> Vec<String>;
fn get_category_tools(
&self,
category: &str,
) -> Vec<(String, Vec<DrawingToolType>)>;
fn get_tool_category(&self, tool: DrawingToolType) -> Option<String>;
fn search_tools(&self, query: &str) -> Vec<DrawingToolType>;
}Expand description
Repository trait for drawing tools data access.
This trait defines the contract for data access. Different implementations can provide data from different sources (static data, JSON files, databases, etc.)
Required Methods§
Sourcefn get_all_categories(&self) -> Vec<String>
fn get_all_categories(&self) -> Vec<String>
Get all available category names in display order
Sourcefn get_category_tools(
&self,
category: &str,
) -> Vec<(String, Vec<DrawingToolType>)>
fn get_category_tools( &self, category: &str, ) -> Vec<(String, Vec<DrawingToolType>)>
Get all tools for a specific category, organized by sections
Returns: Vec<(section_name, tools_in_section)>
Sourcefn get_tool_category(&self, tool: DrawingToolType) -> Option<String>
fn get_tool_category(&self, tool: DrawingToolType) -> Option<String>
Get the category that a tool belongs to
Sourcefn search_tools(&self, query: &str) -> Vec<DrawingToolType>
fn search_tools(&self, query: &str) -> Vec<DrawingToolType>
Search tools by query string (case-insensitive)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".