DataViewProvider

Trait DataViewProvider 

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

Source

fn apply_filter(&mut self, filter: &str) -> Result<(), String>

Apply a filter to the view The filter string format depends on the implementation

Source

fn clear_filters(&mut self)

Clear all filters

Source

fn sort_by( &mut self, column_index: usize, ascending: bool, ) -> Result<(), String>

Sort by a column

Source

fn clear_sort(&mut self)

Clear sorting and return to original order

Provided Methods§

Source

fn get_filtered_count(&self) -> usize

Get the number of rows after filtering

Source

fn is_row_visible(&self, row_index: usize) -> bool

Check if a row index is visible in the current view

Source

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

Source

fn is_sorted(&self) -> bool

Check if data is currently sorted

Source

fn get_sort_state(&self) -> Option<(usize, bool)>

Get current sort state

Implementors§