pub struct Row { /* private fields */ }
Expand description
Represent a table row made of cells
Implementations§
Source§impl Row
impl Row
Sourcepub fn column_count(&self) -> usize
👎Deprecated since 0.8.0: Will become private in future release. See issue #87
pub fn column_count(&self) -> usize
Count the number of column required in the table grid. It takes into account horizontal spanning of cells. For example, a cell with an hspan of 3 will add 3 column to the grid
Sourcepub fn get_height(&self) -> usize
👎Deprecated since 0.8.0: Will become private in future release. See issue #87
pub fn get_height(&self) -> usize
Get the height of this row
Sourcepub fn get_column_width(&self, column: usize, format: &TableFormat) -> usize
👎Deprecated since 0.8.0: Will become private in future release. See issue #87
pub fn get_column_width(&self, column: usize, format: &TableFormat) -> usize
Get the minimum width required by the cell in the column column
.
Return 0 if the cell does not exist in this row
Sourcepub fn get_mut_cell(&mut self, idx: usize) -> Option<&mut Cell>
pub fn get_mut_cell(&mut self, idx: usize) -> Option<&mut Cell>
Get the mutable cell at index idx
Sourcepub fn set_cell(&mut self, cell: Cell, idx: usize) -> Result<(), &str>
pub fn set_cell(&mut self, cell: Cell, idx: usize) -> Result<(), &str>
Set the cell
in the row at the given idx
index
Sourcepub fn insert_cell(&mut self, index: usize, cell: Cell)
pub fn insert_cell(&mut self, index: usize, cell: Cell)
Insert cell
at position index
. If index
is higher than the row length,
the cell will be appended at the end
Sourcepub fn remove_cell(&mut self, index: usize)
pub fn remove_cell(&mut self, index: usize)
Remove the cell at position index
. Silently skip if this cell does not exist
Sourcepub fn print<T: Write + ?Sized>(
&self,
out: &mut T,
format: &TableFormat,
col_width: &[usize],
) -> Result<usize, Error>
👎Deprecated since 0.8.0: Will become private in future release. See issue #87
pub fn print<T: Write + ?Sized>( &self, out: &mut T, format: &TableFormat, col_width: &[usize], ) -> Result<usize, Error>
Print the row to out
, with separator
as column separator, and col_width
specifying the width of each columns. Returns the number of printed lines
Sourcepub fn print_term<T: Terminal + ?Sized>(
&self,
out: &mut T,
format: &TableFormat,
col_width: &[usize],
) -> Result<usize, Error>
👎Deprecated since 0.8.0: Will become private in future release. See issue #87
pub fn print_term<T: Terminal + ?Sized>( &self, out: &mut T, format: &TableFormat, col_width: &[usize], ) -> Result<usize, Error>
Print the row to terminal out
, with separator
as column separator, and col_width
specifying the width of each columns. Apply style when needed. returns the number of printed lines
Trait Implementations§
Source§impl<S: ToString> Extend<S> for Row
impl<S: ToString> Extend<S> for Row
Source§fn extend<T: IntoIterator<Item = S>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = S>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<A: ToString> FromIterator<A> for Row
impl<A: ToString> FromIterator<A> for Row
Source§impl FromIterator<Row> for Table
impl FromIterator<Row> for Table
Source§impl<'a> IntoIterator for &'a Row
impl<'a> IntoIterator for &'a Row
Source§impl<'a> IntoIterator for &'a mut Row
impl<'a> IntoIterator for &'a mut Row
impl Eq for Row
impl StructuralPartialEq for Row
Auto Trait Implementations§
impl Freeze for Row
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)