pub struct XmlStreamReader<R: BufRead> { /* private fields */ }Expand description
A streaming XML reader that enforces XmlSafetyPolicy without retaining a full document.
Implementations§
Source§impl<R: BufRead> XmlStreamReader<R>
impl<R: BufRead> XmlStreamReader<R>
pub fn new(reader: R, policy: XmlSafetyPolicy) -> Result<Self, Error>
pub fn read_event(&mut self) -> Result<XmlStreamEvent<'_>, Error>
Sourcepub fn read_text_current(&mut self) -> Result<String, Error>
pub fn read_text_current(&mut self) -> Result<String, Error>
Reads direct text and CDATA until the end of the current start element.
Sourcepub fn skip_current(&mut self) -> Result<(), Error>
pub fn skip_current(&mut self) -> Result<(), Error>
Skips the current start element and all descendants with constant retained memory.
Sourcepub fn capture_current(
&mut self,
max_bytes: usize,
) -> Result<ValidatedXml, Error>
pub fn capture_current( &mut self, max_bytes: usize, ) -> Result<ValidatedXml, Error>
Materializes only the current subtree as a validated owned XML value.
pub fn into_inner(self) -> R
Auto Trait Implementations§
impl<R> Freeze for XmlStreamReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for XmlStreamReader<R>where
R: RefUnwindSafe,
impl<R> Send for XmlStreamReader<R>where
R: Send,
impl<R> Sync for XmlStreamReader<R>where
R: Sync,
impl<R> Unpin for XmlStreamReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for XmlStreamReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for XmlStreamReader<R>where
R: 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