Struct prettytable::row::Row [] [src]

pub struct Row {
    // some fields omitted
}

Represent a table row made of cells

Methods

impl Row

fn new(cells: Vec<Cell>) -> Row

Create a new Row backed with cells vector

fn empty() -> Row

Create an row of length size, with empty strings stored

fn len(&self) -> usize

Get the number of cells in this row

fn get_height(&self) -> usize

Get the height of this row

fn get_cell_width(&self, column: usize) -> usize

Get the minimum width required by the cell in the column column. Return 0 if the cell does not exist in this row

fn get_cell(&self, idx: usize) -> Option<&Cell>

Get the cell at index idx

fn get_mut_cell(&mut self, idx: usize) -> Option<&mut Cell>

Get the mutable cell at index idx

fn set_cell(&mut self, cell: Cell, column: usize) -> Result<(), &str>

Set the cell in the row at the given column

fn add_cell(&mut self, cell: Cell)

Append a cell at the end of the row

fn insert_cell(&mut self, index: usize, cell: Cell)

Insert cell at position index. If index is higher than the row lenght, the cell will be appended at the end

fn remove_cell(&mut self, index: usize)

Remove the cell at position index. Silently skip if this cell does not exist

fn iter<'a>(&'a self) -> Iter<'a, Cell>

Returns an immutable iterator over cells

fn iter_mut<'a>(&'a mut self) -> IterMut<'a, Cell>

Returns an mutable iterator over cells

fn print<T: Write + ?Sized>(&self, out: &mut T, format: &TableFormat, col_width: &[usize]) -> Result<(), Error>

Print the row to out, with separator as column separator, and col_width specifying the width of each columns

fn print_term<T: Terminal + ?Sized>(&self, out: &mut T, format: &TableFormat, col_width: &[usize]) -> Result<(), 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

Trait Implementations

impl Default for Row

fn default() -> Row

impl Index<usize> for Row

type Output = Cell

fn index(&self, idx: usize) -> &Self::Output

impl IndexMut<usize> for Row

fn index_mut(&mut self, idx: usize) -> &mut Self::Output

impl<A: ToString> FromIterator<A> for Row

fn from_iter<T>(iterator: T) -> Row where T: IntoIterator<Item=A>

impl<T, A> From<T> for Row where A: ToString, T: IntoIterator<Item=A>

fn from(it: T) -> Row

impl<'a> IntoIterator for &'a Row

type Item = &'a Cell

type IntoIter = Iter<'a, Cell>

fn into_iter(self) -> Self::IntoIter

impl<'a> IntoIterator for &'a mut Row

type Item = &'a mut Cell

type IntoIter = IterMut<'a, Cell>

fn into_iter(self) -> Self::IntoIter

Derived Implementations

impl Debug for Row

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for Row

fn clone(&self) -> Row

1.0.0fn clone_from(&mut self, source: &Self)