Struct treexml::Element [] [src]

pub struct Element {
    pub prefix: Option<String>,
    pub name: String,
    pub attributes: HashMap<StringString>,
    pub children: Vec<Element>,
    pub contents: 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<StringString>

Tag attributes

children: Vec<Element>

A vector of child elements

contents: Option<String>

Contents of the element

Methods

impl Element
[src]

fn new<S>(name: S) -> Element where 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

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

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

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

Filters the children of the current Element, given a predicate; returns a mutable iterator

Trait Implementations

impl Eq for Element
[src]

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 !=.

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 Debug for Element
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl Default for Element
[src]

fn default() -> Self

Returns the "default value" for a type. Read more