pub struct RoNode(/* private fields */);
Expand description
Lightweight struct for read-only parallel processing
Implementations§
Source§impl RoNode
impl RoNode
Sourcepub fn node_ptr(&self) -> xmlNodePtr
pub fn node_ptr(&self) -> xmlNodePtr
Immutably borrows the underlying libxml2 xmlNodePtr
pointer
Sourcepub fn get_next_sibling(self) -> Option<RoNode>
pub fn get_next_sibling(self) -> Option<RoNode>
Returns the next sibling if it exists
Sourcepub fn get_prev_sibling(self) -> Option<RoNode>
pub fn get_prev_sibling(self) -> Option<RoNode>
Returns the previous sibling if it exists
Sourcepub fn get_first_child(self) -> Option<RoNode>
pub fn get_first_child(self) -> Option<RoNode>
Returns the first child if it exists
Sourcepub fn get_last_child(self) -> Option<RoNode>
pub fn get_last_child(self) -> Option<RoNode>
Returns the last child if it exists
Sourcepub fn get_next_element_sibling(&self) -> Option<RoNode>
pub fn get_next_element_sibling(&self) -> Option<RoNode>
Returns the next element sibling if it exists
Sourcepub fn get_prev_element_sibling(&self) -> Option<RoNode>
pub fn get_prev_element_sibling(&self) -> Option<RoNode>
Returns the previous element sibling if it exists
Sourcepub fn get_first_element_child(self) -> Option<RoNode>
pub fn get_first_element_child(self) -> Option<RoNode>
Returns the first element child if it exists
Sourcepub fn get_last_element_child(&self) -> Option<RoNode>
pub fn get_last_element_child(&self) -> Option<RoNode>
Returns the last element child if it exists
Sourcepub fn get_child_nodes(self) -> Vec<RoNode>
pub fn get_child_nodes(self) -> Vec<RoNode>
Returns all child nodes of the given node as a vector
Sourcepub fn get_child_elements(self) -> Vec<RoNode>
pub fn get_child_elements(self) -> Vec<RoNode>
Returns all child elements of the given node as a vector
Sourcepub fn get_parent(self) -> Option<RoNode>
pub fn get_parent(self) -> Option<RoNode>
Returns the parent if it exists
Sourcepub fn is_text_node(self) -> bool
pub fn is_text_node(self) -> bool
Returns true if it is a text node
Sourcepub fn is_element_node(self) -> bool
pub fn is_element_node(self) -> bool
Checks if the given node is an Element
Sourcepub fn get_name(self) -> String
pub fn get_name(self) -> String
Returns the name of the node (empty string if name pointer is NULL
)
Sourcepub fn get_content(self) -> String
pub fn get_content(self) -> String
Returns the content of the node (assumes UTF-8 XML document)
Sourcepub fn get_property(self, name: &str) -> Option<String>
pub fn get_property(self, name: &str) -> Option<String>
Returns the value of property name
Sourcepub fn get_property_ns(self, name: &str, ns: &str) -> Option<String>
pub fn get_property_ns(self, name: &str, ns: &str) -> Option<String>
Returns the value of property name
in namespace ns
Sourcepub fn get_property_node(self, name: &str) -> Option<RoNode>
pub fn get_property_node(self, name: &str) -> Option<RoNode>
Return an attribute as a Node
struct of type AttributeNode
Sourcepub fn get_attribute(self, name: &str) -> Option<String>
pub fn get_attribute(self, name: &str) -> Option<String>
Alias for get_property
Sourcepub fn get_attribute_ns(self, name: &str, ns: &str) -> Option<String>
pub fn get_attribute_ns(self, name: &str, ns: &str) -> Option<String>
Alias for get_property_ns
Sourcepub fn get_attribute_node(self, name: &str) -> Option<RoNode>
pub fn get_attribute_node(self, name: &str) -> Option<RoNode>
Alias for get_property_node
Sourcepub fn get_properties(self) -> HashMap<String, String>
pub fn get_properties(self) -> HashMap<String, String>
Get a copy of the attributes of this node
Sourcepub fn get_attributes(self) -> HashMap<String, String>
pub fn get_attributes(self) -> HashMap<String, String>
Alias for get_properties
Sourcepub fn has_property(self, name: &str) -> bool
pub fn has_property(self, name: &str) -> bool
Check if a property has been defined, without allocating its value
Sourcepub fn has_property_ns(self, name: &str, ns: &str) -> bool
pub fn has_property_ns(self, name: &str, ns: &str) -> bool
Check if property name
in namespace ns
exists
Sourcepub fn has_attribute(self, name: &str) -> bool
pub fn has_attribute(self, name: &str) -> bool
Alias for has_property
Sourcepub fn has_attribute_ns(self, name: &str, ns: &str) -> bool
pub fn has_attribute_ns(self, name: &str, ns: &str) -> bool
Alias for has_property_ns
Sourcepub fn get_namespace(self) -> Option<Namespace>
pub fn get_namespace(self) -> Option<Namespace>
Gets the active namespace associated of this node
Sourcepub fn get_namespaces(self, doc: &Document) -> Vec<Namespace>
pub fn get_namespaces(self, doc: &Document) -> Vec<Namespace>
Gets a list of namespaces associated with this node
Sourcepub fn get_namespace_declarations(self) -> Vec<Namespace>
pub fn get_namespace_declarations(self) -> Vec<Namespace>
Get a list of namespaces declared with this node
Sourcepub fn lookup_namespace_prefix(self, href: &str) -> Option<String>
pub fn lookup_namespace_prefix(self, href: &str) -> Option<String>
Looks up the prefix of a namespace from its URI, basedo around a given Node
Sourcepub fn lookup_namespace_uri(self, prefix: &str) -> Option<String>
pub fn lookup_namespace_uri(self, prefix: &str) -> Option<String>
Looks up the uri of a namespace from its prefix, basedo around a given Node
Sourcepub fn get_class_names(self) -> HashSet<String>
pub fn get_class_names(self) -> HashSet<String>
Get a set of class names from this node’s attributes
Sourcepub fn findnodes(self, xpath: &str, owner: &Document) -> Result<Vec<RoNode>, ()>
pub fn findnodes(self, xpath: &str, owner: &Document) -> Result<Vec<RoNode>, ()>
find read-only nodes via xpath, at the specified node and a given document
Sourcepub fn is_unlinked(self) -> bool
pub fn is_unlinked(self) -> bool
Read-only nodes are always linked
Sourcepub fn to_hashable(self) -> usize
pub fn to_hashable(self) -> usize
libc::c_void
isn’t hashable and cannot be made hashable