[][src]Struct serde_xml_rs::EventReader

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

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

Implementations

impl<R> EventReader<R> where
    R: Read
[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, Error>[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> IntoIterator for EventReader<R> where
    R: Read
[src]

type Item = Result<XmlEvent, Error>

The type of the elements being iterated over.

type IntoIter = Events<R>

Which kind of iterator are we turning this into?

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

pub 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>[src]

impl<R> Send for EventReader<R> where
    R: Send
[src]

impl<R> Sync for EventReader<R> where
    R: Sync
[src]

impl<R> Unpin for EventReader<R> where
    R: Unpin
[src]

impl<R> !UnwindSafe for EventReader<R>[src]

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.