Skip to main content

TableState

Struct TableState 

Source
pub struct TableState {
    pub id: CompactString,
    pub columns: Vec<ColumnState>,
    pub highlights: Highlights,
    pub highlights_changed: bool,
    pub active_rows: Vec<usize>,
    pub selected_rows: RoaringBitmap,
    pub expanded_rows: RoaringBitmap,
    pub last_clicked_visible_index: Option<usize>,
    pub filter_matches: RoaringBitmap,
    pub filter_cache_dirty: bool,
    pub sorted_children_cache: HashMap<usize, Vec<usize>, RandomState>,
}

Fields§

§id: CompactString§columns: Vec<ColumnState>§highlights: Highlights§highlights_changed: bool§active_rows: Vec<usize>§selected_rows: RoaringBitmap§expanded_rows: RoaringBitmap§last_clicked_visible_index: Option<usize>§filter_matches: RoaringBitmap§filter_cache_dirty: bool§sorted_children_cache: HashMap<usize, Vec<usize>, RandomState>

Implementations§

Source§

impl TableState

Source

pub fn new(id: impl Into<CompactString>, row_count: usize) -> Self

Source

pub fn get_filter_state(&self) -> Vec<(usize, Filter)>

Source

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

Source

pub fn counts_header(&self, row_len: usize) -> String

Source

pub fn process_responses( &mut self, provider: &dyn TableProvider, responses: Vec<ColResponse>, ) -> Result<(), TableError>

Source

pub fn apply_new_sort( &mut self, provider: &dyn TableProvider, sort_col: usize, ) -> Result<(), TableError>

Source

pub fn apply_all_filters( &mut self, provider: &dyn TableProvider, filters: &[(usize, Filter)], ) -> Result<(), TableError>

Source

pub fn apply_incremental_filter( &mut self, provider: &dyn TableProvider, filter_col: usize, filter: &Filter, ) -> Result<(), TableError>

Source

pub fn show_tree_cell( &mut self, ui: &mut Ui, row_index: usize, hierarchy: RowHierarchy, ) -> bool

Renders the tree indentation guidelines and expand/collapse arrow inside a tree cell. Returns true if the expansion state changed (allowing immediate-mode viewport updates).

Source

pub fn handle_row_selection(&mut self, modifiers: Modifiers, row_index: usize)

Source

pub fn rebuild_tree_filter_cache(&mut self, provider: &dyn TableProvider)

Rebuilds the O(N) reverse-propagation subtree filter cache from scratch if dirty.

Source

pub fn flatten_tree(&mut self, provider: &dyn TableProvider)

Recursively flattens the visible tree nodes matching the active filters into active_rows.

Trait Implementations§

Source§

impl Debug for TableState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TableState

Source§

fn default() -> TableState

Returns the “default value” for a type. Read more
Source§

impl TableStateExt for TableState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.