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 .-> Done
Variants§
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 moreAuto Trait Implementations§
impl Freeze for ParseState
impl RefUnwindSafe for ParseState
impl Send for ParseState
impl Sync for ParseState
impl Unpin for ParseState
impl UnwindSafe for ParseState
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)