[−][src]Module xml_data::parser
Traits and helper structs to parse XML
To implement parsing for your data types (mapping to XML elements) you need intermediate
"state" types (implementing FixedElementState
or ElementState
), which work like "builders":
they will receive the various parts incrementally until they can "build" the result.
To define a default state for your type (so it can be easily found in certain places) you need
to implement Element
.
If your data type should represent multiple elements you need to a state type implementing
InnerState
; the default state is defined by implementing Inner
. If E
implements
Element
, E
, Option<E>
, and Vec<E>
automatically implement Inner
.
To implement parser adaptors for an XML library you need to implement ElementParser
.
Structs
IgnoreElement | Can be used as |
ParseElementList |
|
ParseElementOnce |
|
ParseElementOptional |
|
ParseInnerOptional |
|
ValueDefault | Implements |
ValueString | Implements |
Enums
InnerParseResult | Result of |
Traits
Element | Parsable element |
ElementParser | A parser that is ready to parse exactly one element (and nested data). |
ElementParserExt | extend |
ElementState | A state to parse exactly one element |
FixedElementState | Convenience trait to implement instead of |
Inner | Parsable inner data (multiple elements) |
InnerState | State to parse multiple elements (on the same level) |
Value | Trait to parse attributes and inner text |
Type Definitions
ElementDefaultParseState | Type alias to find the default parse state for an |
InnerDefaultParseState | Type alias to find the default parse state for an |
Derive Macros
Element | Derive |
Inner | Derive |