pub struct EventReader<'a, S: Iterator<Item = &'a u8>> { /* private fields */ }
Expand description
A wrapper around an Iterator which provides pull-based XML parsing.
Implementations§
Source§impl<'a, S: Iterator<Item = &'a u8>> EventReader<'a, S>
impl<'a, S: Iterator<Item = &'a u8>> EventReader<'a, S>
Sourcepub fn new(source: S) -> EventReader<'a, S>
pub fn new(source: S) -> EventReader<'a, S>
Creates a new reader from an Iterator.
Sourcepub fn new_with_config(
source: S,
config: impl Into<ParserConfig2>,
) -> EventReader<'a, S>
pub fn new_with_config( source: S, config: impl Into<ParserConfig2>, ) -> EventReader<'a, S>
Creates a new reader with the provided configuration from an Iterator.
Sourcepub fn next(&mut self) -> Result<XmlEvent>
pub fn next(&mut self) -> Result<XmlEvent>
Pulls and returns next XML event from the Iterator.
If returned event is XmlEvent::Error
or XmlEvent::EndDocument
, then
further calls to this method will return this event again.
Sourcepub fn skip(&mut self) -> Result<()>
pub fn skip(&mut self) -> Result<()>
Skips all XML events until the next end tag at the current level.
Convenience function that is useful for the case where you have encountered a start tag that is of no interest and want to skip the entire XML subtree until the corresponding end tag.
pub fn source(&self) -> &S
pub fn source_mut(&mut self) -> &mut S
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Unwraps this EventReader
, returning the underlying Iterator.
Trait Implementations§
Source§impl<'a, S: Iterator<Item = &'a u8>> IntoIterator for EventReader<'a, S>
impl<'a, S: Iterator<Item = &'a u8>> IntoIterator for EventReader<'a, S>
Source§impl<'a, S: Iterator<Item = &'a u8>> Position for EventReader<'a, S>
impl<'a, S: Iterator<Item = &'a u8>> Position for EventReader<'a, S>
Source§fn position(&self) -> TextPosition
fn position(&self) -> TextPosition
Returns the position of the last event produced by the reader.
Auto Trait Implementations§
impl<'a, S> Freeze for EventReader<'a, S>where
S: Freeze,
impl<'a, S> RefUnwindSafe for EventReader<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for EventReader<'a, S>where
S: Send,
impl<'a, S> Sync for EventReader<'a, S>where
S: Sync,
impl<'a, S> Unpin for EventReader<'a, S>where
S: Unpin,
impl<'a, S> UnwindSafe for EventReader<'a, S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more