Struct prettytable::Row
source · 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)