Skip to main content

DrawingToolsRepository

Trait DrawingToolsRepository 

Source
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§

Source

fn get_all_categories(&self) -> Vec<String>

Get all available category names in display order

Source

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)>

Source

fn get_tool_category(&self, tool: DrawingToolType) -> Option<String>

Get the category that a tool belongs to

Source

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".

Implementors§