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,
}
Expand description

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

Set the max width of a particular column

Set the max widths of specific columns

Simply adds a row to the rows Vec

Does all of the calculations to reformat the row based on it’s current state and returns the result as a String

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Converts the given value to a String. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.