pub struct Table {
pub data: Vec<Vec<String>>,
/* private fields */
}
Fields§
§data: Vec<Vec<String>>
Implementations§
Source§impl Table
impl Table
Sourcepub fn find_first(html: &str) -> Option<Table>
pub fn find_first(html: &str) -> Option<Table>
Finds the first table in html
.
pub fn find_all_tables(html: &str) -> Option<Vec<Table>>
Sourcepub fn find_by_id(html: &str, id: &str) -> Option<Table>
pub fn find_by_id(html: &str, id: &str) -> Option<Table>
Finds the table in html
with an id of id
.
Sourcepub fn find_by_headers<T>(html: &str, headers: &[T]) -> Option<Vec<Table>>
pub fn find_by_headers<T>(html: &str, headers: &[T]) -> Option<Vec<Table>>
Finds the table in html
whose first row contains all of the headers
specified in headers
. The order does not matter.
If headers
is empty, this is the same as
find_first
.
Sourcepub fn headers(&self) -> &HashMap<String, usize>
pub fn headers(&self) -> &HashMap<String, usize>
Returns the headers of the table.
This will be empty if the table had no <th>
tags in its first row. See
Headers
for more.
pub fn empty() -> Table
Trait Implementations§
Source§impl<'a> IntoIterator for &'a Table
impl<'a> IntoIterator for &'a Table
impl Eq for Table
impl StructuralPartialEq for Table
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more