xml_data/parser/default.rs
1use crate::{
2 parser::{
3 ElementState,
4 InnerState,
5 },
6};
7
8/// Parsable element
9///
10/// This links the (default) state type used to parse this element.
11pub trait Element: Sized {
12 /// Parse state to use for this element
13 type ParseState: ElementState<Output = Self>;
14}
15
16/// Type alias to find the default parse state for an `Element`
17pub type ElementDefaultParseState<E> = <E as Element>::ParseState;
18
19/// Parsable inner data (multiple elements)
20///
21/// This links the (default) state type used to parse this.
22pub trait Inner: Sized {
23 /// Parse state to use for this inner data
24 type ParseState: InnerState<Output = Self>;
25}
26
27/// Type alias to find the default parse state for an `Inner`
28pub type InnerDefaultParseState<I> = <I as Inner>::ParseState;