pub struct XmlReader<'a> { /* private fields */ }Expand description
A fast, zero-copy XML reader.
Implementations§
Source§impl<'a> XmlReader<'a>
impl<'a> XmlReader<'a>
Sourcepub fn from_bytes(input: &'a [u8]) -> Self
pub fn from_bytes(input: &'a [u8]) -> Self
Creates a new XML reader from bytes.
Sourcepub fn position(&self) -> Position
pub fn position(&self) -> Position
Returns the current position in the input.
Line/column are computed on demand by scanning the consumed input, so the tokenizer’s hot path only has to track the byte offset.
Sourcepub fn next_event(&mut self) -> Result<XmlEvent<'a>>
pub fn next_event(&mut self) -> Result<XmlEvent<'a>>
Reads the next XML event.
Text content is trimmed of leading and trailing whitespace, and
whitespace-only text nodes are skipped entirely (they never produce
a XmlEvent::Text event).
Auto Trait Implementations§
impl<'a> Freeze for XmlReader<'a>
impl<'a> RefUnwindSafe for XmlReader<'a>
impl<'a> Send for XmlReader<'a>
impl<'a> Sync for XmlReader<'a>
impl<'a> Unpin for XmlReader<'a>
impl<'a> UnsafeUnpin for XmlReader<'a>
impl<'a> UnwindSafe for XmlReader<'a>
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