pub trait DataViewProvider: DataProvider {
// Required methods
fn apply_filter(&mut self, filter: &str) -> Result<(), String>;
fn clear_filters(&mut self);
fn sort_by(
&mut self,
column_index: usize,
ascending: bool,
) -> Result<(), String>;
fn clear_sort(&mut self);
// Provided methods
fn get_filtered_count(&self) -> usize { ... }
fn is_row_visible(&self, row_index: usize) -> bool { ... }
fn get_sorted_indices(
&self,
_column_index: usize,
_ascending: bool,
) -> Vec<usize> { ... }
fn is_sorted(&self) -> bool { ... }
fn get_sort_state(&self) -> Option<(usize, bool)> { ... }
}
Expand description
Extended trait for data views that support filtering and sorting
This trait extends DataProvider with mutable operations that change what data is visible without modifying the underlying data.
Required Methods§
Sourcefn apply_filter(&mut self, filter: &str) -> Result<(), String>
fn apply_filter(&mut self, filter: &str) -> Result<(), String>
Apply a filter to the view The filter string format depends on the implementation
Sourcefn clear_filters(&mut self)
fn clear_filters(&mut self)
Clear all filters
Sourcefn sort_by(
&mut self,
column_index: usize,
ascending: bool,
) -> Result<(), String>
fn sort_by( &mut self, column_index: usize, ascending: bool, ) -> Result<(), String>
Sort by a column
Sourcefn clear_sort(&mut self)
fn clear_sort(&mut self)
Clear sorting and return to original order
Provided Methods§
Sourcefn get_filtered_count(&self) -> usize
fn get_filtered_count(&self) -> usize
Get the number of rows after filtering
Sourcefn is_row_visible(&self, row_index: usize) -> bool
fn is_row_visible(&self, row_index: usize) -> bool
Check if a row index is visible in the current view
Sourcefn get_sorted_indices(
&self,
_column_index: usize,
_ascending: bool,
) -> Vec<usize>
fn get_sorted_indices( &self, _column_index: usize, _ascending: bool, ) -> Vec<usize>
Get sorted indices for a column (for read-only sorting) Returns a vector of indices in sorted order
Sourcefn get_sort_state(&self) -> Option<(usize, bool)>
fn get_sort_state(&self) -> Option<(usize, bool)>
Get current sort state