pub struct Document {
pub nodes: Vec<Raw>,
}
Expand description
An HTML document.
Fields§
§nodes: Vec<Raw>
Implementations§
Source§impl Document
impl Document
Sourcepub fn find<P: Predicate>(&self, predicate: P) -> Find<'_, P> ⓘ
pub fn find<P: Predicate>(&self, predicate: P) -> Find<'_, P> ⓘ
Returns a Selection
containing nodes passing the given predicate p
.
Sourcepub fn nth(&self, n: usize) -> Option<Node<'_>>
pub fn nth(&self, n: usize) -> Option<Node<'_>>
Returns the n
th node of the document as a Some(Node)
, indexed from
0, or None
if n is greater than or equal to the number of nodes.
pub fn from_read<R: Read>(readable: R) -> Result<Document>
Trait Implementations§
Source§impl From<Tendril<UTF8>> for Document
impl From<Tendril<UTF8>> for Document
Source§fn from(tendril: StrTendril) -> Document
fn from(tendril: StrTendril) -> Document
Parses the given StrTendril
into a Document
.
impl Eq for Document
impl StructuralPartialEq for Document
Auto Trait Implementations§
impl Freeze for Document
impl !RefUnwindSafe for Document
impl !Send for Document
impl !Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
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