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>,
    pub separate_rows: bool,
    pub has_top_boarder: bool,
    pub has_bottom_boarder: bool,
}

A set of rows containing data

Fields

rows: Vec<Row<'data>>style: TableStylemax_column_width: usize

The maximum width of all columns. Overridden by values in column_widths. Defaults to std::usize::max

max_column_widths: HashMap<usize, usize>

The maximum widths of specific columns. Override max_column

separate_rows: bool

Whether or not to vertically separate rows in the table

has_top_boarder: bool

Whether 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: bool

Whether the table should have a bottom boarder

Implementations

impl<'data> Table<'data>[src]

pub fn new() -> Table<'data>[src]

pub fn with_rows(rows: Vec<Row<'data>>) -> Table<'data>[src]

pub fn max_column_width(&mut self, max_column_width: usize) -> &mut Self[src]

pub fn set_max_width_for_column(&mut self, column_index: usize, width: usize)[src]

Set the max width of a particular 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

impl<'data> Clone for Table<'data>[src]

impl<'data> Debug for Table<'data>[src]

impl<'data> Default for Table<'data>[src]

impl<'data> ToString for Table<'data>[src]

Auto Trait Implementations

impl<'data> RefUnwindSafe for Table<'data>[src]

impl<'data> Send for Table<'data>[src]

impl<'data> Sync for Table<'data>[src]

impl<'data> Unpin for Table<'data>[src]

impl<'data> UnwindSafe for Table<'data>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.