quick_xml::reader

Enum ParseState

source
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

source§

fn clone(&self) -> ParseState

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ParseState

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.