pub struct RoNode(_);
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