Struct cod_render::prelude::Row
source · pub struct Row<'data> {
pub cells: Vec<TableCell<'data>, Global>,
pub has_separator: bool,
}
Expand description
A set of table cells
Fields§
§cells: Vec<TableCell<'data>, Global>
§has_separator: bool
Whether the row should have a top boarder or not
Implementations§
source§impl<'data> Row<'data>
impl<'data> Row<'data>
pub fn new<I, T>(cells: I) -> Row<'data>where T: Into<TableCell<'data>>, I: IntoIterator<Item = T>,
sourcepub fn format(&self, column_widths: &[usize], style: &TableStyle) -> String
pub fn format(&self, column_widths: &[usize], style: &TableStyle) -> String
Formats a row based on the provided table style
sourcepub fn gen_separator(
&self,
column_widths: &[usize],
style: &TableStyle,
row_position: RowPosition,
previous_separator: Option<String>
) -> String
pub fn gen_separator( &self, column_widths: &[usize], style: &TableStyle, row_position: RowPosition, previous_separator: Option<String> ) -> String
Generates the top separator for a row.
The previous seperator is used to determine junction characters
sourcepub fn split_column_widths(&self) -> Vec<(f32, usize), Global> ⓘ
pub fn split_column_widths(&self) -> Vec<(f32, usize), Global> ⓘ
Returns a vector of split cell widths.
A split width is the cell’s total width divided by it’s col_span value.
Each cell’s split width value is pushed into the resulting vector col_span times. Returns a vec of tuples containing the cell width and the min cell width
sourcepub fn num_columns(&self) -> usize
pub fn num_columns(&self) -> usize
Number of columns in the row.
This is the sum of all cell’s col_span values