pub struct ArticleTextNode<'a> { /* private fields */ }Implementations§
Source§impl<'a> ArticleTextNode<'a>
impl<'a> ArticleTextNode<'a>
pub fn new(inner: Node<'a>) -> Self
Sourcepub fn clean_text(&self) -> String
pub fn clean_text(&self) -> String
Extract the content from the node, but ignore those that not contain parts of the article
Sourcepub fn images(&self, base_url: Option<&Url>) -> Vec<Url>
pub fn images(&self, base_url: Option<&Url>) -> Vec<Url>
Extract all of the images of the document.
Sourcepub fn references(&self) -> Vec<Url>
pub fn references(&self) -> Vec<Url>
Extract all the links within the node’s descendants
Methods from Deref<Target = Node<'a>>§
Sourcepub fn name(&self) -> Option<&'a str>
pub fn name(&self) -> Option<&'a str>
Get the name of a Node if it is an HTML element, or None otherwise.
Sourcepub fn attr(&self, name: &str) -> Option<&'a str>
pub fn attr(&self, name: &str) -> Option<&'a str>
Get the value of the attribute name from a Node representing a HTML element.
Sourcepub fn attrs(&self) -> Attrs<'a> ⓘ
pub fn attrs(&self) -> Attrs<'a> ⓘ
Get an iterator over the names and values of attributes of the Element. Returns an empty iterator for non Element nodes.
pub fn parent(&self) -> Option<Node<'a>>
pub fn prev(&self) -> Option<Node<'a>>
pub fn next(&self) -> Option<Node<'a>>
pub fn first_child(&self) -> Option<Node<'a>>
pub fn last_child(&self) -> Option<Node<'a>>
Sourcepub fn text(&self) -> String
pub fn text(&self) -> String
Get the combined textual content of a Node and all of its children.
Sourcepub fn inner_html(&self) -> String
pub fn inner_html(&self) -> String
Serialize a Node’s children to an HTML string.
Sourcepub fn find<P>(&self, predicate: P) -> Find<'a, P> ⓘwhere
P: Predicate,
pub fn find<P>(&self, predicate: P) -> Find<'a, P> ⓘwhere
P: Predicate,
Search for Nodes fulfilling predicate in the descendants of a Node.
Sourcepub fn as_text(&self) -> Option<&'a str>
pub fn as_text(&self) -> Option<&'a str>
Get the text of a text Node, or None if the node is not text.
Sourcepub fn as_comment(&self) -> Option<&'a str>
pub fn as_comment(&self) -> Option<&'a str>
Get the text of a comment Node, or None if the node is not a comment.
Sourcepub fn descendants(&self) -> Descendants<'a> ⓘ
pub fn descendants(&self) -> Descendants<'a> ⓘ
Construct an iterator over a Node’s descendant (transitive children) Nodes.
Trait Implementations§
Source§impl<'a> Clone for ArticleTextNode<'a>
impl<'a> Clone for ArticleTextNode<'a>
Source§fn clone(&self) -> ArticleTextNode<'a>
fn clone(&self) -> ArticleTextNode<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more