pub struct XmlParser<R: BufRead> {
pub reader: Reader<R>,
pub buf: Vec<u8>,
}Expand description
A low-level XML parser wrapper providing event-based reading with a reusable buffer.
Fields§
§reader: Reader<R>The underlying quick-xml reader.
buf: Vec<u8>Reusable internal buffer for XML event parsing.
Implementations§
Source§impl<R: BufRead> XmlParser<R>
impl<R: BufRead> XmlParser<R>
Sourcepub fn read_next_event(&mut self) -> Result<Event<'_>>
pub fn read_next_event(&mut self) -> Result<Event<'_>>
Reads the next XML event, clearing the internal buffer first.
Sourcepub fn read_text_content(&mut self) -> Result<String>
pub fn read_text_content(&mut self) -> Result<String>
Reads and concatenates text content up to the closing tag, returning the accumulated string.
Sourcepub fn read_to_end(&mut self, end: &[u8]) -> Result<()>
pub fn read_to_end(&mut self, end: &[u8]) -> Result<()>
Skips all XML events until the closing tag matching end is consumed.
Auto Trait Implementations§
impl<R> Freeze for XmlParser<R>where
R: Freeze,
impl<R> RefUnwindSafe for XmlParser<R>where
R: RefUnwindSafe,
impl<R> Send for XmlParser<R>where
R: Send,
impl<R> Sync for XmlParser<R>where
R: Sync,
impl<R> Unpin for XmlParser<R>where
R: Unpin,
impl<R> UnsafeUnpin for XmlParser<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for XmlParser<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more