[−][src]Struct term_table::Table
A set of rows containing data
Fields
rows: Vec<Row<'data>>style: TableStylemax_column_width: usizeThe 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
separate_rows: boolWhether or not to vertically separate rows in the table
has_top_boarder: boolWhether the table should have a top boarder.
Setting has_separator to false on the first row will have the same effect as setting this to false
has_bottom_boarder: boolWhether the table should have a bottom boarder
Methods
impl<'data> Table<'data>[src]
pub fn new() -> Table<'data>[src]
pub fn set_max_column_width(&mut self, column_index: usize, width: usize)[src]
Set the max width of a paticular column
pub fn set_max_column_widths(&mut self, index_width_pairs: Vec<(usize, usize)>)[src]
Set the max widths of specific columns
pub fn add_row(&mut self, row: Row<'data>)[src]
Simply adds a row to the rows Vec
pub fn render(&self) -> String[src]
Does all of the calculations to reformat the row based on it's current
state and returns the result as a String
Trait Implementations
Auto Trait Implementations
impl<'data> Send for Table<'data>
impl<'data> Sync for Table<'data>
impl<'data> Unpin for Table<'data>
impl<'data> UnwindSafe for Table<'data>
impl<'data> RefUnwindSafe for Table<'data>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,