Enum minidom::element::Node [] [src]

pub enum Node {
    Element(Element),
    Text(String),
}

A node in an element tree.

Variants

An Element.

A text node.

Methods

impl Node
[src]

Turns this into an Element if possible, else returns None.

Examples

use minidom::Node;

let elm = Node::Element("<meow />".parse().unwrap());
let txt = Node::Text("meow".to_owned());

assert_eq!(elm.as_element().unwrap().name(), "meow");
assert_eq!(txt.as_element(), None);

Turns this into a String if possible, else returns None.

Examples

use minidom::Node;

let elm = Node::Element("<meow />".parse().unwrap());
let txt = Node::Text("meow".to_owned());

assert_eq!(elm.as_text(), None);
assert_eq!(txt.as_text().unwrap(), "meow");

Trait Implementations

impl Clone for Node
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Node
[src]

Formats the value using the given formatter.

impl PartialEq for Node
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Node
[src]