pub enum BytesEvent<'r, 'src> {
StartElement(BytesStartTag<'r, 'src>),
EndElement(BytesEndTag<'src>),
Text(BytesText<'src>),
CData(BytesCData<'src>),
Comment(BytesComment<'src>),
Pi(BytesPi<'src>),
EntityRef(BytesEntityRef<'src>),
Eof,
}Expand description
A streaming XML event with lazy access to its payload.
Returned by XmlBytesReader::next. Each variant wraps a tag
struct whose methods (name(), attrs(), etc.) extract data on
demand — discard the event without calling a method and you pay
almost nothing. For an eager API that fills a caller-owned buffer
see XmlBytesReader::next_into which returns BytesEventInto.
Variants§
StartElement(BytesStartTag<'r, 'src>)
An opening (or empty-element) start tag.
EndElement(BytesEndTag<'src>)
A closing tag. Emitted once for each StartElement, including
for empty elements (<br/> emits StartElement then EndElement).
Text(BytesText<'src>)
Character data between tags.
CData(BytesCData<'src>)
A <![CDATA[…]]> section.
Comment(BytesComment<'src>)
An XML comment.
Pi(BytesPi<'src>)
A processing instruction.
EntityRef(BytesEntityRef<'src>)
An unresolved entity reference — &foo; left literal in the
event stream. Emitted only when
ParseOptions::resolve_entities is false and the
reference is a user-declared entity (predefined &
etc. and numeric &#NN; refs are always expanded into
Text payloads). Carries the entity name (without the
leading & / trailing ;).
Eof
The document has been fully consumed.