Trait rat_ftable::TableDataIter

source ·
pub trait TableDataIter<'a> {
    // Required methods
    fn rows(&self) -> Option<usize>;
    fn nth(&mut self, n: usize) -> bool;
    fn next(&mut self) -> bool;
    fn row_height(&self) -> u16;
    fn row_style(&self) -> Style;
    fn render_cell(&self, column: usize, area: Rect, buf: &mut Buffer);
}
Expand description

Trait for accessing the table-data by the FTable.

This trait is suitable if the underlying data is an iterator. It uses internal iteration which allows much more leeway with borrowing & lifetimes.

Required Methods§

source

fn rows(&self) -> Option<usize>

Returns the number of rows, if known.

If they are not known, all items will be iterated to calculate things as the length of the table. Which will be slower if you have many items.

source

fn nth(&mut self, n: usize) -> bool

Skips to the nth item, returns true if such an item exists.

source

fn next(&mut self) -> bool

Reads the next item, returns true if such an item exists.

source

fn row_height(&self) -> u16

Row height for the current item.

source

fn row_style(&self) -> Style

Row style for the current line.

source

fn render_cell(&self, column: usize, area: Rect, buf: &mut Buffer)

Render the cell for the current line.

Implementors§