[][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();

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


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>>

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.