pub struct Table<'a> { /* private fields */ }Expand description
A widget to display data in a table.
Implementations§
Source§impl<'a> Table<'a>
impl<'a> Table<'a>
Sourcepub fn new(
rows: impl IntoIterator<Item = Row>,
widths: impl IntoIterator<Item = Constraint>,
) -> Self
pub fn new( rows: impl IntoIterator<Item = Row>, widths: impl IntoIterator<Item = Constraint>, ) -> Self
Create a new table with the given rows and column width constraints.
Sourcepub fn data_hash(self, hash: u64) -> Self
pub fn data_hash(self, hash: u64) -> Self
Set an explicit data hash to enable caching of filtered and sorted indices.
This is highly recommended for large tables. When provided, the table widget
will cache the result of filtering and sorting in the TableState, skipping
expensive O(N) re-evaluation on frames where the hash, filter, and sort
parameters have not changed.
Sourcepub fn highlight_style(self, style: Style) -> Self
pub fn highlight_style(self, style: Style) -> Self
Set the style for the selected row.
Sourcepub fn theme(self, theme: TableTheme) -> Self
pub fn theme(self, theme: TableTheme) -> Self
Set the table theme (base/states/effects).
Sourcepub fn theme_phase(self, phase: f32) -> Self
pub fn theme_phase(self, phase: f32) -> Self
Set the explicit animation phase for theme effects.
Phase is deterministic and should be supplied by the caller (e.g. from tick count).
Sourcepub fn column_spacing(self, spacing: u16) -> Self
pub fn column_spacing(self, spacing: u16) -> Self
Set the spacing between columns.
Trait Implementations§
Source§impl Accessible for Table<'_>
impl Accessible for Table<'_>
Source§fn accessibility_nodes(&self, area: Rect) -> Vec<A11yNodeInfo>
fn accessibility_nodes(&self, area: Rect) -> Vec<A11yNodeInfo>
Return accessibility node(s) for this widget at the given bounds. Read more
Source§impl MeasurableWidget for Table<'_>
impl MeasurableWidget for Table<'_>
Source§impl<'a> StatefulWidget for Table<'a>
impl<'a> StatefulWidget for Table<'a>
Auto Trait Implementations§
impl<'a> Freeze for Table<'a>
impl<'a> RefUnwindSafe for Table<'a>
impl<'a> Send for Table<'a>
impl<'a> Sync for Table<'a>
impl<'a> Unpin for Table<'a>
impl<'a> UnsafeUnpin for Table<'a>
impl<'a> UnwindSafe for Table<'a>
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
Mutably borrows from an owned value. Read more