Struct term_table::Table
source · pub struct Table {
pub rows: Vec<Row>,
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,
}
Expand description
A set of rows containing data
Fields§
§rows: Vec<Row>
§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§
source§impl Table
impl Table
pub fn new() -> Table
pub fn builder() -> TableBuilder
pub fn with_rows(rows: Vec<Row>) -> Table
👎Deprecated since 1.4.0: Use builder instead
pub fn max_column_width(&mut self, max_column_width: usize) -> &mut Self
sourcepub fn set_max_width_for_column(&mut self, column_index: usize, width: usize)
pub fn set_max_width_for_column(&mut self, column_index: usize, width: usize)
Set the max width of a particular column
sourcepub fn set_max_column_widths(&mut self, index_width_pairs: Vec<(usize, usize)>)
pub fn set_max_column_widths(&mut self, index_width_pairs: Vec<(usize, usize)>)
Set the max widths of specific columns
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)