Struct prettytable::Row [−][src]
Represent a table row made of cells
Implementations
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_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, idx: usize) -> Result<(), &str>
[src]
Set the cell
in the row at the given idx
index
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
pub fn iter(&self) -> Iter<'_, Cell>
[src]
Returns an immutable iterator over cells
pub fn iter_mut(&mut self) -> IterMut<'_, Cell>
[src]
Returns an mutable iterator over cells
pub fn print_html<T: Write + ?Sized>(
&self,
out: &mut T,
col_num: usize
) -> Result<(), Error>
[src]
&self,
out: &mut T,
col_num: usize
) -> Result<(), Error>
Print the row in HTML format to out
.
If the row is has fewer columns than col_num
, the row is padded with empty cells.
Trait Implementations
impl Clone for Row
[src]
impl Debug for Row
[src]
impl Default for Row
[src]
impl Eq for Row
[src]
impl<S: ToString> Extend<S> for Row
[src]
fn extend<T: IntoIterator<Item = S>>(&mut self, iter: T)
[src]
pub fn extend_one(&mut self, item: A)
[src]
pub fn extend_reserve(&mut self, additional: usize)
[src]
impl<T, A> From<T> for Row where
A: ToString,
T: IntoIterator<Item = A>,
[src]
A: ToString,
T: IntoIterator<Item = A>,
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>,
impl FromIterator<Row> for Table
[src]
fn from_iter<T>(iterator: T) -> Table where
T: IntoIterator<Item = Row>,
[src]
T: IntoIterator<Item = Row>,
impl Hash for Row
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Index<usize> for Row
[src]
type Output = Cell
The returned type after indexing.
fn index(&self, idx: usize) -> &Self::Output
[src]
impl IndexMut<usize> for Row
[src]
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]
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]
impl PartialEq<Row> for Row
[src]
impl StructuralEq for Row
[src]
impl StructuralPartialEq for Row
[src]
Auto Trait Implementations
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnwindSafe for Row
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,