Struct prettytable::Row [−][src]
pub struct Row { /* fields omitted */ }Represent a table row made of cells
Methods
impl Row[src]
impl Rowpub fn new(cells: Vec<Cell>) -> Row[src]
pub fn new(cells: Vec<Cell>) -> RowCreate a new Row backed with cells vector
pub fn empty() -> Row[src]
pub fn empty() -> RowCreate an row of length size, with empty strings stored
pub fn column_count(&self) -> usize[src]
pub fn column_count(&self) -> usize: Will become private in future release. See issue #87
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
pub fn len(&self) -> usize[src]
pub fn len(&self) -> usizeGet the number of cells in this row
pub fn is_empty(&self) -> bool[src]
pub fn is_empty(&self) -> boolCheck if the row is empty (has no cell)
pub fn get_height(&self) -> usize[src]
pub fn get_height(&self) -> usize: Will become private in future release. See issue #87
Get the height of this row
pub fn get_column_width(&self, column: usize, format: &TableFormat) -> usize[src]
pub fn get_column_width(&self, column: usize, format: &TableFormat) -> usize: Will become private in future release. See issue #87
Get the minimum width required by the cell in the column column.
Return 0 if the cell does not exist in this row
pub fn get_cell(&self, idx: usize) -> Option<&Cell>[src]
pub fn get_cell(&self, idx: usize) -> Option<&Cell>Get the cell at index idx
pub fn get_mut_cell(&mut self, idx: usize) -> Option<&mut Cell>[src]
pub fn get_mut_cell(&mut self, idx: usize) -> Option<&mut Cell>Get the mutable cell at index idx
pub fn set_cell(&mut self, cell: Cell, idx: usize) -> Result<(), &str>[src]
pub fn set_cell(&mut self, cell: Cell, idx: usize) -> Result<(), &str>Set the cell in the row at the given idx index
pub fn add_cell(&mut self, cell: Cell)[src]
pub fn add_cell(&mut self, cell: Cell)Append a cell at the end of the row
pub fn insert_cell(&mut self, index: usize, cell: Cell)[src]
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
pub fn remove_cell(&mut self, index: usize)[src]
pub fn remove_cell(&mut self, index: usize)Remove the cell at position index. Silently skip if this cell does not exist
ⓘImportant traits for Iter<'a, T>pub fn iter(&self) -> Iter<Cell>[src]
pub fn iter(&self) -> Iter<Cell>Returns an immutable iterator over cells
ⓘImportant traits for IterMut<'a, T>pub fn iter_mut(&mut self) -> IterMut<Cell>[src]
pub fn iter_mut(&mut self) -> IterMut<Cell>Returns an mutable iterator over cells
pub fn print<T: Write + ?Sized>(
&self,
out: &mut T,
format: &TableFormat,
col_width: &[usize]
) -> Result<usize, Error>[src]
pub fn print<T: Write + ?Sized>(
&self,
out: &mut T,
format: &TableFormat,
col_width: &[usize]
) -> Result<usize, Error>: Will become private in future release. See issue #87
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
pub fn print_term<T: Terminal + ?Sized>(
&self,
out: &mut T,
format: &TableFormat,
col_width: &[usize]
) -> Result<usize, Error>[src]
pub fn print_term<T: Terminal + ?Sized>(
&self,
out: &mut T,
format: &TableFormat,
col_width: &[usize]
) -> Result<usize, Error>: Will become private in future release. See issue #87
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
impl Clone for Row[src]
impl Clone for Rowfn clone(&self) -> Row[src]
fn clone(&self) -> RowReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Row[src]
impl Debug for Rowfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Hash for Row[src]
impl Hash for Rowfn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash<__H: Hasher>(&self, state: &mut __H)Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl PartialEq for Row[src]
impl PartialEq for Rowfn eq(&self, other: &Row) -> bool[src]
fn eq(&self, other: &Row) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Row) -> bool[src]
fn ne(&self, other: &Row) -> boolThis method tests for !=.
impl Eq for Row[src]
impl Eq for Rowimpl Default for Row[src]
impl Default for Rowimpl Index<usize> for Row[src]
impl Index<usize> for Rowtype Output = Cell
The returned type after indexing.
fn index(&self, idx: usize) -> &Self::Output[src]
fn index(&self, idx: usize) -> &Self::OutputPerforms the indexing (container[index]) operation.
impl IndexMut<usize> for Row[src]
impl IndexMut<usize> for Rowfn index_mut(&mut self, idx: usize) -> &mut Self::Output[src]
fn index_mut(&mut self, idx: usize) -> &mut Self::OutputPerforms the mutable indexing (container[index]) operation.
impl<A: ToString> FromIterator<A> for Row[src]
impl<A: ToString> FromIterator<A> for Rowfn from_iter<T>(iterator: T) -> Row where
T: IntoIterator<Item = A>, [src]
fn from_iter<T>(iterator: T) -> Row where
T: IntoIterator<Item = A>, Creates a value from an iterator. Read more
impl<T, A> From<T> for Row where
A: ToString,
T: IntoIterator<Item = A>, [src]
impl<T, A> From<T> for Row where
A: ToString,
T: IntoIterator<Item = A>, impl<'a> IntoIterator for &'a Row[src]
impl<'a> IntoIterator for &'a Rowtype Item = &'a Cell
The type of the elements being iterated over.
type IntoIter = Iter<'a, Cell>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
fn into_iter(self) -> Self::IntoIterCreates an iterator from a value. Read more
impl<'a> IntoIterator for &'a mut Row[src]
impl<'a> IntoIterator for &'a mut Rowtype Item = &'a mut Cell
The type of the elements being iterated over.
type IntoIter = IterMut<'a, Cell>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter[src]
fn into_iter(self) -> Self::IntoIterCreates an iterator from a value. Read more
impl<S: ToString> Extend<S> for Row[src]
impl<S: ToString> Extend<S> for Rowfn extend<T: IntoIterator<Item = S>>(&mut self, iter: T)[src]
fn extend<T: IntoIterator<Item = S>>(&mut self, iter: T)Extends a collection with the contents of an iterator. Read more
impl FromIterator<Row> for Table[src]
impl FromIterator<Row> for Table