pub trait Node:
Eq
+ Clone
+ Debug {
type ProcessingInstruction: ProcessingInstruction;
type Document: Document<Node = Self>;
type Attribute: Attribute<Node = Self>;
type Element: Element<Node = Self>;
type Opaque: Eq + Hash + 'static;
Show 19 methods
// Required methods
fn is_comment(&self) -> bool;
fn is_text(&self) -> bool;
fn text_content(&self) -> String;
fn language(&self) -> Option<String>;
fn parent(&self) -> Option<Self>;
fn children(&self) -> impl Iterator<Item = Self>;
fn compare_tree_order(&self, other: &Self) -> Ordering;
fn traverse_preorder(&self) -> impl Iterator<Item = Self>;
fn inclusive_ancestors(&self) -> impl Iterator<Item = Self>;
fn preceding_nodes(&self) -> impl Iterator<Item = Self>;
fn following_nodes(&self) -> impl Iterator<Item = Self>;
fn preceding_siblings(&self) -> impl Iterator<Item = Self>;
fn following_siblings(&self) -> impl Iterator<Item = Self>;
fn owner_document(&self) -> Self::Document;
fn to_opaque(&self) -> Self::Opaque;
fn as_processing_instruction(&self) -> Option<Self::ProcessingInstruction>;
fn as_attribute(&self) -> Option<Self::Attribute>;
fn as_element(&self) -> Option<Self::Element>;
fn get_root_node(&self) -> Self;
}Expand description
A handle to a DOM node exposing all functionality needed by xpath.
Required Associated Types§
type ProcessingInstruction: ProcessingInstruction
type Document: Document<Node = Self>
type Attribute: Attribute<Node = Self>
type Element: Element<Node = Self>
type Opaque: Eq + Hash + 'static
Required Methods§
fn is_comment(&self) -> bool
fn is_text(&self) -> bool
Sourcefn text_content(&self) -> String
fn text_content(&self) -> String
Equivalent to textContent attribute.
fn parent(&self) -> Option<Self>
fn children(&self) -> impl Iterator<Item = Self>
Sourcefn compare_tree_order(&self, other: &Self) -> Ordering
fn compare_tree_order(&self, other: &Self) -> Ordering
Sourcefn traverse_preorder(&self) -> impl Iterator<Item = Self>
fn traverse_preorder(&self) -> impl Iterator<Item = Self>
A non-shadow-including preorder traversal.
fn inclusive_ancestors(&self) -> impl Iterator<Item = Self>
Sourcefn preceding_nodes(&self) -> impl Iterator<Item = Self>
fn preceding_nodes(&self) -> impl Iterator<Item = Self>
Return an iterator over all nodes that come before self in tree order,
excluding any ancestors and attribute nodes.
Sourcefn following_nodes(&self) -> impl Iterator<Item = Self>
fn following_nodes(&self) -> impl Iterator<Item = Self>
Return an iterator over all nodes that come after self in tree order,
excluding any descendants and attribute nodes.
fn preceding_siblings(&self) -> impl Iterator<Item = Self>
fn following_siblings(&self) -> impl Iterator<Item = Self>
fn owner_document(&self) -> Self::Document
fn to_opaque(&self) -> Self::Opaque
fn as_processing_instruction(&self) -> Option<Self::ProcessingInstruction>
fn as_attribute(&self) -> Option<Self::Attribute>
fn as_element(&self) -> Option<Self::Element>
fn get_root_node(&self) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.