Enum fast_scraper::node::Node
source · pub enum Node {
Document,
Fragment,
Doctype(Doctype),
Comment(Comment),
Text(Text),
Element(Element),
ProcessingInstruction(ProcessingInstruction),
}
Expand description
An HTML node.
Variants§
Document
The document root.
Fragment
The fragment root.
Doctype(Doctype)
A doctype.
Comment(Comment)
A comment.
Text(Text)
Text.
Element(Element)
An element.
ProcessingInstruction(ProcessingInstruction)
A processing instruction.
Implementations§
source§impl Node
impl Node
sourcepub fn is_document(&self) -> bool
pub fn is_document(&self) -> bool
Returns true if node is the document root.
sourcepub fn is_fragment(&self) -> bool
pub fn is_fragment(&self) -> bool
Returns true if node is the fragment root.
sourcepub fn is_doctype(&self) -> bool
pub fn is_doctype(&self) -> bool
Returns true if node is a doctype.
sourcepub fn is_comment(&self) -> bool
pub fn is_comment(&self) -> bool
Returns true if node is a comment.
sourcepub fn is_element(&self) -> bool
pub fn is_element(&self) -> bool
Returns true if node is an element.
sourcepub fn as_doctype(&self) -> Option<&Doctype>
pub fn as_doctype(&self) -> Option<&Doctype>
Returns self as a doctype.
sourcepub fn as_comment(&self) -> Option<&Comment>
pub fn as_comment(&self) -> Option<&Comment>
Returns self as a comment.
sourcepub fn as_element(&self) -> Option<&Element>
pub fn as_element(&self) -> Option<&Element>
Returns self as an element.
sourcepub fn as_processing_instruction(&self) -> Option<&ProcessingInstruction>
pub fn as_processing_instruction(&self) -> Option<&ProcessingInstruction>
Returns self as an element.