pub enum Event<'r, 'src> {
StartElement(StartTag<'r, 'src>),
EndElement(EndTag<'src>),
Text(Text<'src>),
CData(CData<'src>),
Comment(Comment<'src>),
Pi(Pi<'src>),
EntityRef(EntityRef<'src>),
Eof,
}Expand description
A streaming XML event with lazy access to its payload.
Returned by XmlReader::next. Each variant wraps a tag struct
whose methods (name(), attrs(), as_str(), etc.) extract data
on demand. For an eager API that fills a caller-owned buffer see
XmlReader::next_into which returns EventInto.
Variants§
StartElement(StartTag<'r, 'src>)
An opening (or empty-element) start tag.
EndElement(EndTag<'src>)
A closing tag. Emitted once for each StartElement, including
for empty elements (<br/> emits StartElement then EndElement).
Text(Text<'src>)
Character data between tags.
CData(CData<'src>)
A <![CDATA[…]]> section.
Comment(Comment<'src>)
An XML comment.
Pi(Pi<'src>)
A processing instruction.
EntityRef(EntityRef<'src>)
An unresolved entity reference (&name;) — emitted only when
ParseOptions::resolve_entities is false. Carries the
entity name without the surrounding & / ;.
Eof
The document has been fully consumed.
Trait Implementations§
Auto Trait Implementations§
impl<'r, 'src> !RefUnwindSafe for Event<'r, 'src>
impl<'r, 'src> !UnwindSafe for Event<'r, 'src>
impl<'r, 'src> Freeze for Event<'r, 'src>
impl<'r, 'src> Send for Event<'r, 'src>
impl<'r, 'src> Sync for Event<'r, 'src>
impl<'r, 'src> Unpin for Event<'r, 'src>
impl<'r, 'src> UnsafeUnpin for Event<'r, 'src>
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