Trait QueryableStore
Source pub trait QueryableStore<T>: Send + Sync {
// Required methods
fn apply_filters(&self, data: Vec<T>, filter: &Value) -> Vec<T>;
fn apply_sort(&self, data: Vec<T>, sort: &str) -> Vec<T>;
fn list_all(&self) -> Vec<T>;
}
Expand description
Trait for stores that support filtering and sorting
Implement this trait for stores that support generic querying with
filters and sorting capabilities.
Apply filters to a collection of entities
§Parameters
data: Collection of entities to filter
filter: Filter criteria as JSON Value
§Returns
Filtered collection
Apply sorting to a collection of entities
§Parameters
data: Collection of entities to sort (will be modified)
sort: Sort expression (e.g., “field:asc” or “field:desc”)
§Returns
Sorted collection
Get all entities (unfiltered, unsorted)