Struct libxml::readonly::RoNode

source ·
pub struct RoNode(_);
Expand description

Lightweight struct for read-only parallel processing

Implementations§

source§

impl RoNode

source

pub fn node_ptr(&self) -> xmlNodePtr

Immutably borrows the underlying libxml2 xmlNodePtr pointer

source

pub fn get_next_sibling(self) -> Option<RoNode>

Returns the next sibling if it exists

source

pub fn get_prev_sibling(self) -> Option<RoNode>

Returns the previous sibling if it exists

source

pub fn get_first_child(self) -> Option<RoNode>

Returns the first child if it exists

source

pub fn get_last_child(self) -> Option<RoNode>

Returns the last child if it exists

source

pub fn get_next_element_sibling(&self) -> Option<RoNode>

Returns the next element sibling if it exists

source

pub fn get_prev_element_sibling(&self) -> Option<RoNode>

Returns the previous element sibling if it exists

source

pub fn get_first_element_child(self) -> Option<RoNode>

Returns the first element child if it exists

source

pub fn get_last_element_child(&self) -> Option<RoNode>

Returns the last element child if it exists

source

pub fn get_child_nodes(self) -> Vec<RoNode>

Returns all child nodes of the given node as a vector

source

pub fn get_child_elements(self) -> Vec<RoNode>

Returns all child elements of the given node as a vector

source

pub fn get_parent(self) -> Option<RoNode>

Returns the parent if it exists

source

pub fn get_type(self) -> Option<NodeType>

Get the node type

source

pub fn is_text_node(self) -> bool

Returns true if it is a text node

source

pub fn is_element_node(self) -> bool

Checks if the given node is an Element

source

pub fn is_null(self) -> bool

Checks if the underlying libxml2 pointer is NULL

source

pub fn get_name(self) -> String

Returns the name of the node (empty string if name pointer is NULL)

source

pub fn get_content(self) -> String

Returns the content of the node (assumes UTF-8 XML document)

source

pub fn get_property(self, name: &str) -> Option<String>

Returns the value of property name

source

pub fn get_property_ns(self, name: &str, ns: &str) -> Option<String>

Returns the value of property name in namespace ns

source

pub fn get_property_node(self, name: &str) -> Option<RoNode>

Return an attribute as a Node struct of type AttributeNode

source

pub fn get_attribute(self, name: &str) -> Option<String>

Alias for get_property

source

pub fn get_attribute_ns(self, name: &str, ns: &str) -> Option<String>

Alias for get_property_ns

source

pub fn get_attribute_node(self, name: &str) -> Option<RoNode>

Alias for get_property_node

source

pub fn get_properties(self) -> HashMap<String, String>

Get a copy of the attributes of this node

source

pub fn get_attributes(self) -> HashMap<String, String>

Alias for get_properties

source

pub fn has_property(self, name: &str) -> bool

Check if a property has been defined, without allocating its value

source

pub fn has_property_ns(self, name: &str, ns: &str) -> bool

Check if property name in namespace ns exists

source

pub fn has_attribute(self, name: &str) -> bool

Alias for has_property

source

pub fn has_attribute_ns(self, name: &str, ns: &str) -> bool

Alias for has_property_ns

source

pub fn get_namespace(self) -> Option<Namespace>

Gets the active namespace associated of this node

source

pub fn get_namespaces(self, doc: &Document) -> Vec<Namespace>

Gets a list of namespaces associated with this node

source

pub fn get_namespace_declarations(self) -> Vec<Namespace>

Get a list of namespaces declared with this node

source

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

source

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

source

pub fn get_class_names(self) -> HashSet<String>

Get a set of class names from this node’s attributes

source

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

source

pub fn is_unlinked(self) -> bool

Read-only nodes are always linked

source

pub fn to_hashable(self) -> usize

libc::c_void isn’t hashable and cannot be made hashable

source

pub fn null() -> Self

Create a mock node, used for a placeholder argument

Trait Implementations§

source§

impl Clone for RoNode

source§

fn clone(&self) -> RoNode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RoNode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<RoNode> for RoNode

source§

fn eq(&self, other: &RoNode) -> bool

Two nodes are considered equal, if they point to the same xmlNode.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for RoNode

source§

impl Eq for RoNode

source§

impl Send for RoNode

source§

impl Sync for RoNode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.