[][src]Struct xml::ElementBuilder

pub struct ElementBuilder { /* fields omitted */ }

An Element Builder, building Elements from Events as produced by Parser

use xml::{Parser, ElementBuilder};

let mut parser = Parser::new();
let mut builder = ElementBuilder::new();

parser.feed_str("<example/>");
for result in parser.filter_map(|event| builder.handle_event(event)) {
    println!("{}", result.unwrap());
}

Methods

impl ElementBuilder[src]

pub fn new() -> ElementBuilder[src]

Returns a new ElementBuilder

pub fn define_prefix(&mut self, prefix: String, ns: String)[src]

Bind a prefix to a namespace

pub fn set_default_ns(&mut self, ns: String)[src]

Set the default namespace

pub fn handle_event(
    &mut self,
    e: Result<Event, ParserError>
) -> Option<Result<Element, BuilderError>>
[src]

Let the builder process an Event to ultimately build an Element.

While no root element has been finished None is returned. Once sufficent data has been received an Element is returned as Some(Ok(elem)). Upon Error Some(Err("message")) is returned.

Auto Trait Implementations

impl RefUnwindSafe for ElementBuilder

impl Send for ElementBuilder

impl Sync for ElementBuilder

impl Unpin for ElementBuilder

impl UnwindSafe for ElementBuilder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.