[][src]Struct xml::reader::EventReader

pub struct EventReader<R: Read> { /* fields omitted */ }

A wrapper around an std::io::Read instance which provides pull-based XML parsing.

Methods

impl<R: Read> EventReader<R>[src]

pub fn new(source: R) -> EventReader<R>[src]

Creates a new reader, consuming the given stream.

pub fn new_with_config(source: R, config: ParserConfig) -> EventReader<R>[src]

Creates a new reader with the provded configuration, consuming the given stream.

pub fn next(&mut self) -> Result<XmlEvent>[src]

Pulls and returns next XML event from the stream.

If returned event is XmlEvent::Error or XmlEvent::EndDocument, then further calls to this method will return this event again.

pub fn source(&self) -> &R[src]

pub fn source_mut(&mut self) -> &mut R[src]

pub fn into_inner(self) -> R[src]

Unwraps this EventReader, returning the underlying reader.

Note that this operation is destructive; unwrapping the reader and wrapping it again with EventReader::new() will create a fresh reader which will attempt to parse an XML document from the beginning.

impl<'r> EventReader<&'r [u8]>[src]

pub fn from_str(source: &'r str) -> EventReader<&'r [u8]>[src]

A convenience method to create an XmlReader from a string slice.

Trait Implementations

impl<R: Read> IntoIterator for EventReader<R>[src]

type Item = Result<XmlEvent>

The type of the elements being iterated over.

type IntoIter = Events<R>

Which kind of iterator are we turning this into?

impl<B: Read> Position for EventReader<B>[src]

fn position(&self) -> TextPosition[src]

Returns the position of the last event produced by the reader.

Auto Trait Implementations

impl<R> !RefUnwindSafe for EventReader<R>

impl<R> Send for EventReader<R> where
    R: Send

impl<R> Sync for EventReader<R> where
    R: Sync

impl<R> Unpin for EventReader<R> where
    R: Unpin

impl<R> !UnwindSafe for EventReader<R>

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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.