[][src]Struct table_extract::Row

pub struct Row<'a> { /* fields omitted */ }

A row in a Table.

A row consists of a number of data cells stored as strings. If the row contains the same number of cells as the table's header row, its cells can be safely accessed by header names using get. Otherwise, the data should be accessed via as_slice or by iterating over the row.

This struct can be thought of as a lightweight reference into a table. As such, it implements the Copy trait.

Methods

impl<'a> Row<'a>[src]

pub fn len(&self) -> usize[src]

Returns the number of cells in the row.

pub fn is_empty(&self) -> bool[src]

Returns true if the row contains no cells.

pub fn get(&self, header: &str) -> Option<&'a str>[src]

Returns the cell underneath header.

Returns None if there is no such header, or if there is no cell at that position in the row.

pub fn as_slice(&self) -> &'a [String][src]

Returns a slice containing all the cells.

pub fn iter(&self) -> Iter<String>[src]

Returns an iterator over the cells of the row.

Trait Implementations

impl<'a> IntoIterator for Row<'a>[src]

type Item = &'a String

The type of the elements being iterated over.

type IntoIter = Iter<'a, String>

Which kind of iterator are we turning this into?

impl<'a> Clone for Row<'a>[src]

impl<'a> Copy for Row<'a>[src]

impl<'a> Eq for Row<'a>[src]

impl<'a> PartialEq<Row<'a>> for Row<'a>[src]

impl<'a> Debug for Row<'a>[src]

impl<'a> StructuralPartialEq for Row<'a>[src]

impl<'a> StructuralEq for Row<'a>[src]

Auto Trait Implementations

impl<'a> Send for Row<'a>

impl<'a> Sync for Row<'a>

impl<'a> Unpin for Row<'a>

impl<'a> UnwindSafe for Row<'a>

impl<'a> RefUnwindSafe for Row<'a>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]