Struct treexml::Element
[−]
[src]
pub struct Element { pub prefix: Option<String>, pub name: String, pub attributes: HashMap<String, String>, pub children: Vec<Element>, pub text: Option<String>, pub cdata: Option<String>, }
An XML element
Fields
prefix: Option<String>
Tag prefix, used for namespacing: xsl
in xsl:for-each
name: String
Tag name: for-each
in xsl:for-each
attributes: HashMap<String, String>
Tag attributes
children: Vec<Element>
A vector of child elements
text: Option<String>
Contents of the element
cdata: Option<String>
CDATA contents of the element
Methods
impl Element
[src]
fn new<S>(name: S) -> Element where
S: Into<String>,
S: Into<String>,
Create a new Element
with the tag name name
fn find_child<P>(&self, predicate: P) -> Option<&Element> where
P: for<'r> Fn(&'r &Element) -> bool,
P: for<'r> Fn(&'r &Element) -> bool,
Find a single child of the current Element
, given a predicate
fn find_child_mut<P>(&mut self, predicate: P) -> Option<&mut Element> where
P: for<'r> FnMut(&'r &mut Element) -> bool,
P: for<'r> FnMut(&'r &mut Element) -> bool,
Find a single child of the current Element
, given a predicate; returns a mutable borrow
fn filter_children<P>(&self, predicate: P) -> Filter<Iter<Element>, P> where
P: for<'r> Fn(&'r &Element) -> bool,
P: for<'r> Fn(&'r &Element) -> bool,
Filters the children of the current Element
, given a predicate
fn filter_children_mut<P>(
&mut self,
predicate: P
) -> Filter<IterMut<Element>, P> where
P: for<'r> FnMut(&'r &mut Element) -> bool,
&mut self,
predicate: P
) -> Filter<IterMut<Element>, P> where
P: for<'r> FnMut(&'r &mut Element) -> bool,
Filters the children of the current Element
, given a predicate; returns a mutable iterator
Trait Implementations
impl Debug for Element
[src]
impl Clone for Element
[src]
fn clone(&self) -> Element
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Element
[src]
fn eq(&self, __arg_0: &Element) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Element) -> bool
This method tests for !=
.