Trait TableDataVec

Source
pub trait TableDataVec<D>: TableData<'static> {
    // Required method
    fn set_data(&mut self, data: Rc<RefCell<Vec<D>>>);
}
Expand description

Extends TableData with the capability to set the actual data at a later point in time.

This is needed to inject the data during rendering, while leaving the rendering to the caller.

Due to life-time issues the data is given as Rc<>.

Required Methods§

Source

fn set_data(&mut self, data: Rc<RefCell<Vec<D>>>)

Set the actual table data.

Trait Implementations§

Source§

impl<'a, D> TableData<'a> for Box<dyn TableDataVec<D> + 'a>

Source§

fn rows(&self) -> usize

Size of the data.
Source§

fn header(&self) -> Option<Row<'a>>

Header can be obtained from here. Alternative to setting on Table.
Source§

fn footer(&self) -> Option<Row<'a>>

Footer can be obtained from here. Alternative to setting on Table.
Source§

fn row_height(&self, row: usize) -> u16

Row height.
Source§

fn row_style(&self, row: usize) -> Option<Style>

Row style.
Source§

fn widths(&self) -> Vec<Constraint>

Column constraints.
Source§

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

Render the cell given by column/row. Read more

Implementors§