Struct rat_ftable::FTableState
source · pub struct FTableState<Selection> {Show 17 fields
pub area: Rect,
pub header_area: Rect,
pub table_area: Rect,
pub row_areas: Vec<Rect>,
pub column_areas: Vec<Rect>,
pub footer_area: Rect,
pub rows: usize,
pub columns: usize,
pub row_offset: usize,
pub col_offset: usize,
pub row_page_len: usize,
pub col_page_len: usize,
pub max_row_offset: usize,
pub max_col_offset: usize,
pub selection: Selection,
pub mouse: MouseFlags,
pub non_exhaustive: NonExhaustive,
}Expand description
FTable state.
Fields§
§area: Rect§header_area: RectTotal header area.
table_area: RectTotal table area.
row_areas: Vec<Rect>Area per visible row.
column_areas: Vec<Rect>Area per visible column.
Total footer area.
rows: usizeRow count.
columns: usizeColumn count.
row_offset: usizeCurrent row offset. Automatically capped at rows-1.
col_offset: usizeCurrent column offset. Automatically capped at columns-1.
row_page_len: usizeCurrent page len as items.
col_page_len: usizeCurrent page width as columns.
max_row_offset: usizeMaximum offset for row-scrolling. Can be set higher, but this offset guarantees a full page display.
max_col_offset: usizeMaximum offset for column-scrolling. Can be set higher, but this offset guarantees a full page display.
selection: SelectionSelection data.
mouse: MouseFlagsHelper for mouse interactions.
non_exhaustive: NonExhaustiveImplementations§
source§impl<Selection> FTableState<Selection>
impl<Selection> FTableState<Selection>
sourcepub fn column_at_clicked(&self, pos: Position) -> Option<usize>
pub fn column_at_clicked(&self, pos: Position) -> Option<usize>
Column at given position.
sourcepub fn row_at_clicked(&self, pos: Position) -> Option<usize>
pub fn row_at_clicked(&self, pos: Position) -> Option<usize>
Row at given position.
sourcepub fn cell_at_drag(&self, pos: Position) -> (usize, usize)
pub fn cell_at_drag(&self, pos: Position) -> (usize, usize)
Cell when dragging. Can go outside the area.
sourcepub fn row_at_drag(&self, pos: Position) -> usize
pub fn row_at_drag(&self, pos: Position) -> usize
Row when dragging. Can go outside the area.
sourcepub fn column_at_drag(&self, pos: Position) -> usize
pub fn column_at_drag(&self, pos: Position) -> usize
Column when dragging. Can go outside the area.
source§impl<Selection: TableSelection> FTableState<Selection>
impl<Selection: TableSelection> FTableState<Selection>
sourcepub fn set_row_offset(&mut self, offset: usize) -> bool
pub fn set_row_offset(&mut self, offset: usize) -> bool
Change the vertical offset. Returns true, if there was some change to the offset, even if clipped.
sourcepub fn set_column_offset(&mut self, offset: usize) -> bool
pub fn set_column_offset(&mut self, offset: usize) -> bool
Change the horizontal offset. Returns true, if there was some change to the offset, even if clipped.
sourcepub fn scroll_down(&mut self, n: usize) -> bool
pub fn scroll_down(&mut self, n: usize) -> bool
Scroll down by n items.
sourcepub fn scroll_left(&mut self, n: usize) -> bool
pub fn scroll_left(&mut self, n: usize) -> bool
Scroll up by n items.
sourcepub fn scroll_right(&mut self, n: usize) -> bool
pub fn scroll_right(&mut self, n: usize) -> bool
Scroll down by n items.
source§impl<Selection: TableSelection> FTableState<Selection>
impl<Selection: TableSelection> FTableState<Selection>
sourcepub fn scroll_to_selected(&mut self)
pub fn scroll_to_selected(&mut self)
Scroll to selected.
Trait Implementations§
source§impl<Selection: Clone> Clone for FTableState<Selection>
impl<Selection: Clone> Clone for FTableState<Selection>
source§fn clone(&self) -> FTableState<Selection>
fn clone(&self) -> FTableState<Selection>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<Selection: Debug> Debug for FTableState<Selection>
impl<Selection: Debug> Debug for FTableState<Selection>
source§impl<Selection: Default> Default for FTableState<Selection>
impl<Selection: Default> Default for FTableState<Selection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<CellSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<CellSelection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<NoSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<NoSelection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<RowSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<RowSelection>
source§impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<RowSetSelection>
impl HandleEvent<Event, FocusKeys, Outcome> for FTableState<RowSetSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<CellSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<CellSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<NoSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<NoSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<RowSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<RowSelection>
source§impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<RowSetSelection>
impl HandleEvent<Event, MouseOnly, Outcome> for FTableState<RowSetSelection>
Auto Trait Implementations§
impl<Selection> Freeze for FTableState<Selection>where
Selection: Freeze,
impl<Selection> RefUnwindSafe for FTableState<Selection>where
Selection: RefUnwindSafe,
impl<Selection> Send for FTableState<Selection>where
Selection: Send,
impl<Selection> Sync for FTableState<Selection>where
Selection: Sync,
impl<Selection> Unpin for FTableState<Selection>where
Selection: Unpin,
impl<Selection> UnwindSafe for FTableState<Selection>where
Selection: UnwindSafe,
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> 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