Struct comfy_table::Row
source · pub struct Row { /* private fields */ }
Implementations§
source§impl Row
impl Row
pub fn new() -> Self
sourcepub fn add_cell(&mut self, cell: Cell) -> &mut Self
pub fn add_cell(&mut self, cell: Cell) -> &mut Self
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 crate::Table::discover_columns.
use comfy_table::{Row, Cell};
let mut row = Row::new();
row.add_cell(Cell::new("One"));
sourcepub fn max_height(&mut self, lines: usize) -> &mut Self
pub fn max_height(&mut self, lines: usize) -> &mut Self
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);
sourcepub fn cell_count(&self) -> usize
pub fn cell_count(&self) -> usize
Get the amount of cells on this row.
Trait Implementations§
source§impl<T: Into<Cells>> From<T> for Row
impl<T: Into<Cells>> From<T> for Row
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]);
Auto Trait Implementations§
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnwindSafe for Row
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