[−]Struct serde_xml_rs::EventReader
A wrapper around an std::io::Read
instance which provides pull-based XML parsing.
Methods
impl<R> EventReader<R> where
R: Read,
R: Read,
pub fn new(source: R) -> EventReader<R>
Creates a new reader, consuming the given stream.
pub fn new_with_config(source: R, config: ParserConfig) -> EventReader<R>
Creates a new reader with the provded configuration, consuming the given stream.
pub fn next(&mut self) -> Result<XmlEvent, Error>
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
pub fn source_mut(&mut self) -> &mut R
pub fn into_inner(self) -> R
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]>
pub fn from_str(source: &'r str) -> EventReader<&'r [u8]>
A convenience method to create an XmlReader
from a string slice.
Trait Implementations
impl<B> Position for EventReader<B> where
B: Read,
B: Read,
fn position(&self) -> TextPosition
Returns the position of the last event produced by the reader.
impl<R> IntoIterator for EventReader<R> where
R: Read,
R: Read,
Auto Trait Implementations
impl<R> Send for EventReader<R> where
R: Send,
R: Send,
impl<R> Sync for EventReader<R> where
R: Sync,
R: Sync,
Blanket Implementations
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,