pub struct Table<'a> { /* private fields */ }Expand description
A data table with column headers, rows, and optional row selection.
Implementations§
Source§impl<'a> Table<'a>
impl<'a> Table<'a>
Sourcepub fn widths(self, widths: Vec<u16>) -> Self
pub fn widths(self, widths: Vec<u16>) -> Self
Sets explicit column widths. If not set, widths are auto-distributed.
Sourcepub fn scroll_offset(self, offset: u16) -> Self
pub fn scroll_offset(self, offset: u16) -> Self
Sets the scroll offset from the top.
Sourcepub fn palette(self, palette: AislingPalette) -> Self
pub fn palette(self, palette: AislingPalette) -> Self
Sets the color palette.
Sourcepub fn render_with_interaction(
&self,
frame: &mut Frame<'_>,
id: impl Into<WidgetId>,
area: Rect,
)
pub fn render_with_interaction( &self, frame: &mut Frame<'_>, id: impl Into<WidgetId>, area: Rect, )
Renders into a Scrin frame and registers hit regions for visible rows.
Sourcepub fn hit_regions(&self, id: impl Into<WidgetId>, area: Rect) -> Vec<HitRegion>
pub fn hit_regions(&self, id: impl Into<WidgetId>, area: Rect) -> Vec<HitRegion>
Builds Scrin interaction metadata for the visible table rows.
Sourcepub fn selectable_spans(
&self,
id: impl Into<WidgetId>,
area: Rect,
) -> Vec<SelectableSpan>
pub fn selectable_spans( &self, id: impl Into<WidgetId>, area: Rect, ) -> Vec<SelectableSpan>
Builds selectable spans for visible table rows.
Sourcepub fn scroll_region(
&self,
id: impl Into<WidgetId>,
area: Rect,
) -> Option<(Rect, usize, Vec<ScrollRowHit>)>
pub fn scroll_region( &self, id: impl Into<WidgetId>, area: Rect, ) -> Option<(Rect, usize, Vec<ScrollRowHit>)>
Builds Scrin scroll-region metadata for visible table rows.
Trait Implementations§
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<W> AislingExt for Wwhere
W: Widget,
impl<W> AislingExt for Wwhere
W: Widget,
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