pub struct TableRenderContext {Show 18 fields
pub row_count: usize,
pub visible_row_indices: Vec<usize>,
pub data_rows: Vec<Vec<String>>,
pub column_headers: Vec<String>,
pub column_widths: Vec<u16>,
pub pinned_column_indices: Vec<usize>,
pub pinned_count: usize,
pub selected_row: usize,
pub selected_column: usize,
pub row_viewport: Range<usize>,
pub selection_mode: SelectionMode,
pub sort_state: Option<SortState>,
pub show_row_numbers: bool,
pub app_mode: AppMode,
pub fuzzy_filter_pattern: Option<String>,
pub case_insensitive: bool,
pub available_width: u16,
pub available_height: u16,
}Expand description
All the data needed to render a table, collected in one place This allows the table renderer to be independent of TUI internals
Fields§
§row_count: usizeTotal number of rows in the dataset
visible_row_indices: Vec<usize>Row indices to display (the visible viewport)
data_rows: Vec<Vec<String>>The actual data to display (already formatted as strings) Outer vec is rows, inner vec is columns
column_headers: Vec<String>Column headers in visual order
column_widths: Vec<u16>Column widths in visual order (matching column_headers)
pinned_column_indices: Vec<usize>Indices of pinned columns (in visual space)
pinned_count: usizeNumber of pinned columns (convenience field)
selected_row: usizeCurrently selected row (absolute index, not viewport-relative)
selected_column: usizeCurrently selected column (visual index)
row_viewport: Range<usize>Row viewport range (start..end absolute indices)
selection_mode: SelectionModeSelection mode (Cell or Row)
sort_state: Option<SortState>Sort state (which column is sorted and how)
show_row_numbers: boolWhether to show row numbers
app_mode: AppModeCurrent application mode (for title bar)
fuzzy_filter_pattern: Option<String>Fuzzy filter pattern if active
case_insensitive: boolWhether filter is case insensitive
available_width: u16Available width for the table (excluding borders)
available_height: u16Available height for the table (excluding borders)
Implementations§
Source§impl TableRenderContext
impl TableRenderContext
Sourcepub fn is_selected_row(&self, viewport_row_index: usize) -> bool
pub fn is_selected_row(&self, viewport_row_index: usize) -> bool
Check if a given row is the currently selected row
Sourcepub fn is_selected_column(&self, visual_column_index: usize) -> bool
pub fn is_selected_column(&self, visual_column_index: usize) -> bool
Check if a given column is the currently selected column
Sourcepub fn is_pinned_column(&self, visual_column_index: usize) -> bool
pub fn is_pinned_column(&self, visual_column_index: usize) -> bool
Check if a column is pinned
Sourcepub fn get_crosshair(&self) -> (usize, usize)
pub fn get_crosshair(&self) -> (usize, usize)
Get the crosshair position (selected cell)
Sourcepub fn is_crosshair_cell(
&self,
viewport_row_index: usize,
visual_column_index: usize,
) -> bool
pub fn is_crosshair_cell( &self, viewport_row_index: usize, visual_column_index: usize, ) -> bool
Check if we’re at a specific cell
Sourcepub fn get_sort_indicator(&self, visual_column_index: usize) -> &str
pub fn get_sort_indicator(&self, visual_column_index: usize) -> &str
Get sort indicator for a column
Sourcepub fn cell_matches_filter(&self, cell_value: &str) -> bool
pub fn cell_matches_filter(&self, cell_value: &str) -> bool
Check if a cell value matches the fuzzy filter
Trait Implementations§
Source§impl Clone for TableRenderContext
impl Clone for TableRenderContext
Source§fn clone(&self) -> TableRenderContext
fn clone(&self) -> TableRenderContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TableRenderContext
impl RefUnwindSafe for TableRenderContext
impl Send for TableRenderContext
impl Sync for TableRenderContext
impl Unpin for TableRenderContext
impl UnwindSafe for TableRenderContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more