Type Alias xrust::trees::intmuttree::RNode
source · pub type RNode = Rc<Node>;
Aliased Type§
struct RNode { /* private fields */ }
Trait Implementations§
source§impl Node for RNode
impl Node for RNode
source§fn to_xml_with_options(&self, od: &OutputDefinition) -> String
fn to_xml_with_options(&self, od: &OutputDefinition) -> String
Serialise the node as XML, with options such as indentation.
source§fn pop(&mut self) -> Result<(), Error>
fn pop(&mut self) -> Result<(), Error>
Remove a node from the tree. If the node is unattached (i.e. does not have a parent), then this has no effect.
source§fn add_attribute(&self, att: Self) -> Result<(), Error>
fn add_attribute(&self, att: Self) -> Result<(), Error>
Add an attribute to this element-type node
source§fn insert_before(&mut self, insert: Self) -> Result<(), Error>
fn insert_before(&mut self, insert: Self) -> Result<(), Error>
Insert a node into the child list immediately before this node.
source§fn shallow_copy(&self) -> Result<Self, Error>
fn shallow_copy(&self) -> Result<Self, Error>
Shallow copy the node. Returned node is unattached.
type NodeIterator = Box<dyn Iterator<Item = Rc<Node>>>
source§fn name(&self) -> QualifiedName
fn name(&self) -> QualifiedName
Get the name of the node. If the node doesn’t have a name, then returns a QualifiedName with an empty string for it’s localname.
source§fn value(&self) -> Value
fn value(&self) -> Value
Get the value of the node. If the node doesn’t have a value, then returns a Value that is an empty string.
source§fn document_order(&self) -> Vec<usize>
fn document_order(&self) -> Vec<usize>
Get the document order of the node. The value returned is relative to the document containing the node.
Depending on the implementation, this value may be volatile;
adding or removing nodes to/from the document may invalidate the ordering.
source§fn cmp_document_order(&self, other: &Self) -> Ordering
fn cmp_document_order(&self, other: &Self) -> Ordering
Compare the document order of this node with another node in the same document.
source§fn child_iter(&self) -> Self::NodeIterator
fn child_iter(&self) -> Self::NodeIterator
An iterator over the children of the node
source§fn ancestor_iter(&self) -> Self::NodeIterator
fn ancestor_iter(&self) -> Self::NodeIterator
An iterator over the ancestors of the node
source§fn owner_document(&self) -> Self
fn owner_document(&self) -> Self
Get the document node
source§fn descend_iter(&self) -> Self::NodeIterator
fn descend_iter(&self) -> Self::NodeIterator
An iterator over the descendants of the node
source§fn next_iter(&self) -> Self::NodeIterator
fn next_iter(&self) -> Self::NodeIterator
An iterator over the following siblings of the node
source§fn prev_iter(&self) -> Self::NodeIterator
fn prev_iter(&self) -> Self::NodeIterator
An iterator over the preceding siblings of the node
source§fn attribute_iter(&self) -> Self::NodeIterator
fn attribute_iter(&self) -> Self::NodeIterator
An iterator over the attributes of an element
source§fn get_attribute(&self, a: &QualifiedName) -> Value
fn get_attribute(&self, a: &QualifiedName) -> Value
Get an attribute of the node. Returns a copy of the attribute’s value. If the node does not have an attribute of the given name, a value containing an empty string is returned.
source§fn new_element(&self, qn: QualifiedName) -> Result<Self, Error>
fn new_element(&self, qn: QualifiedName) -> Result<Self, Error>
Create a new element-type node in the same document tree. The new node is not attached to the tree.
source§fn new_text(&self, v: Value) -> Result<Self, Error>
fn new_text(&self, v: Value) -> Result<Self, Error>
Create a new text-type node in the same document tree. The new node is not attached to the tree.
source§fn new_attribute(&self, qn: QualifiedName, v: Value) -> Result<Self, Error>
fn new_attribute(&self, qn: QualifiedName, v: Value) -> Result<Self, Error>
Create a new attribute-type node in the same document tree. The new node is not attached to the tree.
source§fn new_comment(&self, v: Value) -> Result<Self, Error>
fn new_comment(&self, v: Value) -> Result<Self, Error>
Create a new comment-type node in the same document tree. The new node is not attached to the tree.
source§fn new_processing_instruction(
&self,
qn: QualifiedName,
v: Value
) -> Result<Self, Error>
fn new_processing_instruction( &self, qn: QualifiedName, v: Value ) -> Result<Self, Error>
Create a new processing-instruction-type node in the same document tree. The new node is not attached to the tree.
source§fn get_canonical(&self) -> Result<Self, Error>
fn get_canonical(&self) -> Result<Self, Error>
Canonical XML representation of the node
source§fn is_element(&self) -> bool
fn is_element(&self) -> bool
Check if a node is an element-type
source§fn first_child(&self) -> Option<Self>where
Self: Sized,
fn first_child(&self) -> Option<Self>where
Self: Sized,
Get the first child of the node, if there is one