Struct comfy_table::Row
source · [−]pub struct Row { /* private fields */ }Implementations
sourceimpl 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.
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
sourceimpl<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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more