[−][src]Struct term_table::Table
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 render(&self) -> String
[src]
pub fn render(&self) -> String
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
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
impl<T> ToString for T where
T: Display + ?Sized,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T