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.
Trait Implementations§
impl Eq for Node
impl Send for Node
impl StructuralPartialEq for Node
impl Sync for Node
Auto Trait Implementations§
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