Struct comfy_table::Row

source ·
pub struct Row { /* private fields */ }
Expand description

Each row contains Cells and can be added to a Table.

Implementations

Add a cell to the row.

Attention: If a row has already been added to a table and you add more cells to it than there’re columns currently know to the Table struct, these columns won’t be known to the table unless you call [Table::discover_columns].

use comfy_table::{Row, Cell};

let mut row = Row::new();
row.add_cell(Cell::new("One"));

Truncate content of cells which occupies more than X lines of space.

use comfy_table::{Row, Cell};

let mut row = Row::new();
row.max_height(5);

Get the amount of cells on this row.

Returns an iterator over all cells of this row

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

Create a Row from any Into<Cells>.
Cells is a simple wrapper around a Vec<Cell>.

Check the From implementations on Cell for more information.

use comfy_table::{Row, Cell};

let row = Row::from(vec!["One", "Two", "Three",]);
let row = Row::from(vec![
   Cell::new("One"),
   Cell::new("Two"),
   Cell::new("Three"),
]);
let row = Row::from(vec![1, 2, 3, 4]);
Converts to this type from the input type.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.