Struct term_table::row::Row
source · pub struct Row {
pub cells: Vec<TableCell>,
pub has_separator: bool,
}
Expand description
A set of table cells
Fields§
§cells: Vec<TableCell>
§has_separator: bool
Whether the row should have a top boarder or not
Implementations§
source§impl Row
impl Row
pub fn new<I, T>(cells: I) -> Row
pub fn empty() -> Row
pub fn without_separator<I, T>(cells: I) -> Row
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)>
pub fn split_column_widths(&self) -> Vec<(f32, usize)>
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
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Row
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnwindSafe for Row
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)