enum ParseState {
Init,
InsideMarkup,
InsideText,
InsideEmpty,
Done,
}Expand description
Possible reader states. The state transition diagram (true and false shows
value of Config::expand_empty_elements option):
flowchart LR
subgraph _
direction LR
Init -- "(no event)"\n --> InsideMarkup
InsideMarkup -- Decl, DocType, PI\nComment, CData\nStart, Empty, End --> InsideText
InsideText -- "#lt;false#gt;\n(no event)"\nText --> InsideMarkup
end
InsideText -- "#lt;true#gt;"\nStart --> InsideEmpty
InsideEmpty -- End --> InsideText
_ -. Eof .-> DoneVariants§
Init
Initial state in which reader stay after creation. Transition from that
state could produce a Text, Decl, Comment or Start event. The next
state is always InsideMarkup. The reader will never return to this state. The
event emitted during transition to InsideMarkup is a StartEvent if the
first symbol not <, otherwise no event are emitted.
InsideMarkup
State after seeing the < symbol. Depending on the next symbol all other
events could be generated.
After generating one event the reader moves to the InsideText state.
InsideText
State in which reader searches the < symbol of a markup. All bytes before
that symbol will be returned in the Event::Text event. After that
the reader moves to the InsideMarkup state.
InsideEmpty
This state is used only if option expand_empty_elements is set to true.
Reader enters to this state when it is in a InsideText state and emits an
Event::Start event. The next event emitted will be an Event::End,
after which reader returned to the InsideText state.
Done
Reader enters this state when Eof event generated or an error occurred.
This is the last state, the reader stay in it forever.
Trait Implementations§
Source§impl Clone for ParseState
impl Clone for ParseState
Source§fn clone(&self) -> ParseState
fn clone(&self) -> ParseState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more