pub struct TableState {
pub column_widths: Vec<f32>,
pub column_order: Vec<usize>,
pub sort_column: Option<usize>,
pub sort_ascending: bool,
pub column_filters: Vec<String>,
pub current_page: usize,
pub page_size: usize,
pub pinned_columns: usize,
pub zebra_striping: bool,
}Expand description
Serialisable snapshot of the mutable UI state of a Table.
Only the view state is captured — not the data source itself. This is deliberately scoped to what a user would expect to have restored between sessions: column layout, sort, filters, pagination, and display flags.
Fields§
§column_widths: Vec<f32>Runtime column widths (logical pixels) in logical column order.
column_order: Vec<usize>Column render order: column_order[i] is the logical column index at
render position i.
sort_column: Option<usize>Active sort column index, or None for no sort.
sort_ascending: booltrue = ascending, false = descending. Ignored when sort_column
is None.
column_filters: Vec<String>Per-column filter text strings (empty = no filter). Indexed by logical column index.
current_page: usizeCurrent page (0-based) in paginated mode.
page_size: usizeRows per page. 0 disables pagination.
pinned_columns: usizeNumber of leftmost columns pinned (frozen) during horizontal scrolling.
zebra_striping: boolWhether alternate rows are rendered with a different background colour.
Implementations§
Source§impl TableState
impl TableState
Sourcepub fn from_table_fields(
column_widths: Vec<f32>,
column_order: Vec<usize>,
sort_column: Option<usize>,
sort_ascending: bool,
column_filters: Vec<String>,
current_page: usize,
page_size: usize,
pinned_columns: usize,
zebra_striping: bool,
) -> Self
pub fn from_table_fields( column_widths: Vec<f32>, column_order: Vec<usize>, sort_column: Option<usize>, sort_ascending: bool, column_filters: Vec<String>, current_page: usize, page_size: usize, pinned_columns: usize, zebra_striping: bool, ) -> Self
Create a TableState from the current settings of a
Table.
This is a non-generic helper that accepts the individual fields directly
to avoid a trait bound cycle between this module and table.rs.
Trait Implementations§
Source§impl Clone for TableState
impl Clone for TableState
Source§fn clone(&self) -> TableState
fn clone(&self) -> TableState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TableState
impl Debug for TableState
Source§impl Default for TableState
impl Default for TableState
Source§impl PartialEq for TableState
impl PartialEq for TableState
Source§fn eq(&self, other: &TableState) -> bool
fn eq(&self, other: &TableState) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TableState
Auto Trait Implementations§
impl Freeze for TableState
impl RefUnwindSafe for TableState
impl Send for TableState
impl Sync for TableState
impl Unpin for TableState
impl UnsafeUnpin for TableState
impl UnwindSafe for TableState
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> 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