Struct prettytable::row::Row
[−]
[src]
pub struct Row { /* fields omitted */ }
Represent a table row made of cells
Methods
impl Row
[src]
pub fn new(cells: Vec<Cell>) -> Row
[src]
Create a new Row
backed with cells
vector
pub fn empty() -> Row
[src]
Create an row of length size
, with empty strings stored
pub fn len(&self) -> usize
[src]
Get the number of cells in this row
pub fn is_empty(&self) -> bool
[src]
Check if the row is empty (has no cell)
pub fn get_height(&self) -> usize
[src]
Get the height of this row
pub fn get_cell_width(&self, column: usize) -> usize
[src]
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]
Get the cell at index idx
pub fn get_mut_cell(&mut self, idx: usize) -> Option<&mut Cell>
[src]
Get the mutable cell at index idx
pub fn set_cell(&mut self, cell: Cell, column: usize) -> Result<(), &str>
[src]
Set the cell
in the row at the given column
pub fn add_cell(&mut self, cell: Cell)
[src]
Append a cell
at the end of the row
pub fn insert_cell(&mut self, index: usize, cell: Cell)
[src]
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]
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]
Returns an immutable iterator over cells
ⓘImportant traits for IterMut<'a, T>pub fn iter_mut(&mut self) -> IterMut<Cell>
[src]
Returns an mutable iterator over cells
pub fn print<T: Write + ?Sized>(
&self,
out: &mut T,
format: &TableFormat,
col_width: &[usize]
) -> Result<(), Error>
[src]
&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
pub fn print_term<T: Terminal + ?Sized>(
&self,
out: &mut T,
format: &TableFormat,
col_width: &[usize]
) -> Result<(), Error>
[src]
&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 Clone for Row
[src]
fn clone(&self) -> Row
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Row
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Hash for Row
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
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]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl PartialEq for Row
[src]
fn eq(&self, __arg_0: &Row) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Row) -> bool
[src]
This method tests for !=
.
impl Eq for Row
[src]
impl Default for Row
[src]
impl Index<usize> for Row
[src]
type Output = Cell
The returned type after indexing.
fn index(&self, idx: usize) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<usize> for Row
[src]
fn index_mut(&mut self, idx: usize) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl<A: ToString> FromIterator<A> for Row
[src]
fn from_iter<T>(iterator: T) -> Row where
T: IntoIterator<Item = A>,
[src]
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]
A: ToString,
T: IntoIterator<Item = A>,
impl<'a> IntoIterator for &'a Row
[src]
type 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]
Creates an iterator from a value. Read more
impl<'a> IntoIterator for &'a mut Row
[src]
type 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]
Creates an iterator from a value. Read more
impl<S: ToString> Extend<S> for Row
[src]
fn extend<T: IntoIterator<Item = S>>(&mut self, iter: T)
[src]
Extends a collection with the contents of an iterator. Read more