pub enum ResolvedEvent {
    XMLDeclaration(EventMetricsXMLVersion),
    StartElement(EventMetricsResolvedQNameHashMap<ResolvedQName, CData>),
    EndElement(EventMetrics),
    Text(EventMetricsCData),
}
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(EventMetricsXMLVersion)

Tuple Fields

0: EventMetrics

Number of bytes contributing to this event.

This includes all bytes from the opening <? until and including the closing ?>.

1: XMLVersion

XML version number

The XML declaration.

This mirrors RawEvent::XMLDeclaration.

StartElement(EventMetricsResolvedQNameHashMap<ResolvedQName, CData>)

Tuple Fields

0: EventMetrics

Number 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: ResolvedQName

The 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: EventMetrics

Number 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(EventMetricsCData)

Tuple Fields

0: EventMetrics

Number 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: CData

Text 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

Return the EventMetrics of the event

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.