[−][src]Struct xml::ElementBuilder
An Element Builder, building Element
s from Event
s 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]
&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,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,