Struct xml::reader::EventReader
[−]
[src]
pub struct EventReader<B: Read> { // some fields omitted }
Simple wrapper around an std::io::BufReader
which provides pull-based XML parsing.
Methods
impl<B: Read> EventReader<B>
fn new(source: B) -> EventReader<B>
Creates a new parser, consuming given stream.
fn with_config(source: B, config: ParserConfig) -> EventReader<B>
Creates a new parser with the provded configuration, consuming given Buffer
.
fn next(&mut self) -> XmlEvent
Pulls and returns next XML event from the stream.
If returned event is xml::event::Error
or xml::event::EndDocument
, then
further calls to this method will return this event again.
fn events<'a>(&'a mut self) -> Events<'a, B>
Returns an iterator over XML events.
When the next event is xml::event::Error
or xml::event::EndDocument
, then
it will be returned by the iterator once, and then it will stop producing events.
impl<'r> EventReader<&'r [u8]>
fn from_str(source: &'r str) -> EventReader<&'r [u8]>
Convenience method to create a reader from a string slice.