xml_data/parser/mod.rs
1//! Traits and helper structs to parse XML
2//!
3//! To implement parsing for your data types (mapping to XML elements) you need intermediate
4//! "state" types (implementing `FixedElementState` or `ElementState`), which work like "builders":
5//! they will receive the various parts incrementally until they can "build" the result.
6//!
7//! To define a default state for your type (so it can be easily found in certain places) you need
8//! to implement `Element`.
9//!
10//! If your data type should represent multiple elements you need to a state type implementing
11//! `InnerState`; the default state is defined by implementing `Inner`. If `E` implements
12//! `Element`, `E`, `Option<E>`, and `Vec<E>` automatically implement `Inner`.
13//!
14//! To implement parser adaptors for an XML library you need to implement `ElementParser`.
15
16mod core;
17mod default;
18mod extensions;
19mod fixed_element;
20mod ignore;
21mod inner;
22mod value;
23
24#[cfg(feature = "derive")]
25pub use xml_data_derive::{
26 ParserElement as Element,
27 ParserInner as Inner,
28};
29
30pub use self::{
31 core::{
32 ElementState,
33 ElementParser,
34 },
35 default::{
36 Element,
37 ElementDefaultParseState,
38 Inner,
39 InnerDefaultParseState,
40 },
41 extensions::{
42 ElementParserExt,
43 },
44 fixed_element::{
45 FixedElementState,
46 },
47 ignore::{
48 IgnoreElement,
49 },
50 inner::{
51 InnerState,
52 InnerParseResult,
53 ParseElementOnce,
54 ParseElementOptional,
55 ParseElementList,
56 ParseInnerOptional,
57 },
58 value::{
59 Value,
60 ValueDefault,
61 ValueString,
62 },
63};