Enum rxml::ResolvedEvent
source · [−]pub enum ResolvedEvent {
XMLDeclaration(EventMetrics, XMLVersion),
StartElement(EventMetrics, ResolvedQName, HashMap<ResolvedQName, CData>),
EndElement(EventMetrics),
Text(EventMetrics, CData),
}Expand description
High-level, logical XML document parts
The term Event is borrowed from SAX terminology. Each ResolvedEvent
refers to a bit of the XML document which has been parsed.
In contrast to the RawEvent, observing a ResolvedEvent from a
NamespaceResolver which is fed by a RawParser guarantees that
the XML document has been well-formed and namespace-well-formed up to this
point (for the caveats about observing a RawEvent, see RawParser).
Each event has EventMetrics attached which give information about the
number of bytes from the input stream used to generate the event.
Variants
XMLDeclaration(EventMetrics, XMLVersion)
Tuple Fields
0: EventMetricsNumber of bytes contributing to this event.
This includes all bytes from the opening <? until and including
the closing ?>.
1: XMLVersionXML version number
The XML declaration.
This mirrors RawEvent::XMLDeclaration.
StartElement(EventMetrics, ResolvedQName, HashMap<ResolvedQName, CData>)
Tuple Fields
0: EventMetricsNumber of bytes contributing to this event.
If this is the root element, this also includes any whitespace between the XML declaration and the start of the root element.
1: ResolvedQNameThe namespace URI / localpart pair of the element.
2: HashMap<ResolvedQName, CData>Attributes declared on the element, without XML namespace declarations.
The start of an XML element.
EndElement(EventMetrics)
Tuple Fields
0: EventMetricsNumber of bytes contributing to this event.
The number of bytes may be zero if this event is emitted in
response to a /> in an element header, because the bytes for
/> are accounted for in the corresponding
Self::StartElement.
The end of an XML element.
The parser enforces that start/end pairs are correctly nested.
Text(EventMetrics, CData)
Tuple Fields
0: EventMetricsNumber of bytes contributing to this event.
Note that due to the expansion of character references and the processing of CDATA sections, the number of bytes consumed will generally be not equal to the number of bytes in emitted.
1: CDataText content
References are expanded and CDATA sections processed correctly, so that the text in the event exactly corresponds to the logical character data.
Text CData.
This mirrors RawEvent::Text.
Note: Multiple consecutive Text events may be emitted for long
sections of text or because of implementation details in the
processing.
Implementations
sourceimpl ResolvedEvent
impl ResolvedEvent
sourcepub fn metrics(&self) -> &EventMetrics
pub fn metrics(&self) -> &EventMetrics
Return the EventMetrics of the event
Trait Implementations
sourceimpl Clone for ResolvedEvent
impl Clone for ResolvedEvent
sourcefn clone(&self) -> ResolvedEvent
fn clone(&self) -> ResolvedEvent
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ResolvedEvent
impl Debug for ResolvedEvent
sourceimpl PartialEq<ResolvedEvent> for ResolvedEvent
impl PartialEq<ResolvedEvent> for ResolvedEvent
sourcefn eq(&self, other: &ResolvedEvent) -> bool
fn eq(&self, other: &ResolvedEvent) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ResolvedEvent) -> bool
fn ne(&self, other: &ResolvedEvent) -> bool
This method tests for !=.
impl Eq for ResolvedEvent
impl StructuralEq for ResolvedEvent
impl StructuralPartialEq for ResolvedEvent
Auto Trait Implementations
impl RefUnwindSafe for ResolvedEvent
impl Send for ResolvedEvent
impl Sync for ResolvedEvent
impl Unpin for ResolvedEvent
impl UnwindSafe for ResolvedEvent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more