Struct term_table::Table [−][src]
pub struct Table<'data> {
pub rows: Vec<Row<'data>>,
pub style: TableStyle,
pub max_column_width: usize,
pub max_column_widths: HashMap<usize, usize>,
}A set of rows containing data
Fields
rows: Vec<Row<'data>>
style: TableStyle
max_column_width: usize
The maximum width of all columns. Overriden by values in column_widths. Defults to std::usize::max
max_column_widths: HashMap<usize, usize>
The maxium widths of specific columns. Override max_column
Methods
impl<'data> Table<'data>[src]
impl<'data> Table<'data>pub fn new() -> Table<'data>[src]
pub fn new() -> Table<'data>pub fn set_max_column_width(&mut self, column_index: usize, width: usize)[src]
pub fn set_max_column_width(&mut self, column_index: usize, width: usize)Set the max width of a paticular column
pub fn set_max_column_widths(&mut self, index_width_pairs: Vec<(usize, usize)>)[src]
pub fn set_max_column_widths(&mut self, index_width_pairs: Vec<(usize, usize)>)Set the max widths of specific columns
pub fn add_row(&mut self, row: Row<'data>)[src]
pub fn add_row(&mut self, row: Row<'data>)Simply adds a row to the rows Vec
pub fn as_string(&mut self) -> String[src]
pub fn as_string(&mut self) -> StringDoes all of the calculations to reformat the row based on it's current
state and returns the result as a String