CellDecorator

Trait CellDecorator 

Source
pub trait CellDecorator {
    // Required method
    fn decorate_cell(
        &mut self,
        column: usize,
        row: usize,
        has_more: bool,
        area: Area<'_>,
        row_height: Mm,
    ) -> Mm;

    // Provided methods
    fn set_table_size(&mut self, num_columns: usize, num_rows: usize) { ... }
    fn prepare_cell<'p>(
        &self,
        column: usize,
        row: usize,
        area: Area<'p>,
    ) -> Area<'p> { ... }
}
Expand description

A decorator for table cells.

Implementations of this trait can be used to style cells of a TableLayout.

Required Methods§

Source

fn decorate_cell( &mut self, column: usize, row: usize, has_more: bool, area: Area<'_>, row_height: Mm, ) -> Mm

Styles the cell with the given indizes thas has been rendered within the given area and the given row height and return the total row height.

Provided Methods§

Source

fn set_table_size(&mut self, num_columns: usize, num_rows: usize)

Sets the size of the table.

This function is called once before the first call to prepare_cell or decorate_cell.

Source

fn prepare_cell<'p>( &self, column: usize, row: usize, area: Area<'p>, ) -> Area<'p>

Prepares the cell with the given indizes and returns the area for rendering the cell.

Implementors§