Struct term_table::Table [−][src]
A set of rows containing data
Fields
rows: Vec<Row<'data>>
style: TableStyle
max_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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,