XmlState

Enum XmlState 

Source
pub enum XmlState {
Show 43 variants Data, TagState, EndTagState, EndTagName, EndTagNameAfter, Pi, PiTarget, PiTargetAfter, PiData, PiAfter, MarkupDecl, CommentStart, CommentStartDash, Comment, CommentLessThan, CommentLessThanBang, CommentLessThanBangDash, CommentLessThanBangDashDash, CommentEnd, CommentEndDash, CommentEndBang, Cdata, CdataBracket, CdataEnd, TagName, TagEmpty, TagAttrNameBefore, TagAttrName, TagAttrNameAfter, TagAttrValueBefore, TagAttrValue(AttrValueKind), Doctype, BeforeDoctypeName, DoctypeName, AfterDoctypeName, AfterDoctypeKeyword(DoctypeKind), BeforeDoctypeIdentifier(DoctypeKind), DoctypeIdentifierDoubleQuoted(DoctypeKind), DoctypeIdentifierSingleQuoted(DoctypeKind), AfterDoctypeIdentifier(DoctypeKind), BetweenDoctypePublicAndSystemIdentifiers, BogusDoctype, BogusComment,
}
Expand description

Specifies the different states a XML tokenizer will assume during parsing.

Variants§

§

Data

The initial state of the parser.

It is equivalent to the Data state of the html parser, except null codepoints do not cause errors.

§

TagState

Indicates that the parser has found a < character and will try to parse a tag.

§

EndTagState

Indicates that the parser has consumed the / of a closing tag, like </foo>.

§

EndTagName

Indicates that the parser is currently parsing the name of a closing tag, like the foo of </foo>.

§

EndTagNameAfter

Indicates that the parser has finished parsing the name of a closing tag and expects a > to follow.

§

Pi

Indicates that the parser has started parsing a processing instruction (PI).

This state is reached after the initial ? character has been consumed.

§

PiTarget

Indicates that the parser is currently parsing the target of a processing instruction.

For example, the target of <?xml-stylesheet type="text/xsl" href="style.xsl"?> is xml-stylesheet.

§

PiTargetAfter

Indicates that the parser has finished parsing the target of a processing instruction.

§

PiData

Indicates that the parser is currently parsing the data of a processing instruction.

The “data” refers to everything between the target and the closing ? character.

§

PiAfter

Indicates that the parser has parsed the closing ? of a processing instruction.

§

MarkupDecl

Indicates that the parser has parsed the initial ! of a markup declaration.

Examples of such declarations include <!ENTITY chap1 SYSTEM "chap1.xml"> or <!-- Comment -->.

§

CommentStart

Indicates that the parser has parsed the start of a comment (<!--).

§

CommentStartDash

Indicates that the parser has parsed the start of a comment and a - directly after it.

§

Comment

Indicates that the parser is currently parsing the data within a comment.

§

CommentLessThan

Indicates that the parser has parsed a < character within a comment.

§

CommentLessThanBang

Indicates that the parser has parsed <! within a comment.

§

CommentLessThanBangDash

Indicates that the parser has parsed <!- within a comment.

§

CommentLessThanBangDashDash

Indicates that the parser has parsed <!-- within a comment.

§

CommentEnd

Indicates that the parser has parsed two - characters within a comment which may or may not be the beginning of the comment end (-->).

§

CommentEndDash

Indicates that the parser has parsed a - character within a comment which may or may not be the beginning of the comment end (-->).

§

CommentEndBang

Indicates that the parser has parsed --! within a comment which may or may not be part of the end of the comment. Comments in XML can be closed with --!>.

§

Cdata

Indicates that the parser has parsed the beginning of a CDATA section (<![CDATA[).

§

CdataBracket

Indicates that the parser has parsed a ] character within a CDATA section, which may be part of the end of the section (]]>).

§

CdataEnd

Indicates that the parser has parsed two ] characters within a CDATA section, which may be part of the end of the section (]]>).

§

TagName

Indicates that the parser is currently parsing the name of a tag, such as foo in <foo>.

§

TagEmpty

Indicates that the parser has parsed the / of a self-closing tag, such as <foo/>.

§

TagAttrNameBefore

Indicates that the parser has finished parsing the name of a tag and is now expecting either attributes or a >.

§

TagAttrName

Indicates that the parser is currently parsing the name of an attribute within a tag, such as bar in <foo bar=baz>.

§

TagAttrNameAfter

Indicates that the parser has finished parsing the name of an attribute.

§

TagAttrValueBefore

Indicates that the parser is about to parse the value of an attribute.

§

TagAttrValue(AttrValueKind)

Indicates that the parser is currently parsing the value of an attribute, such as baz in <foo bar=baz>.

Includes information about how the value is quoted, because the quotes before and after the attribute value need to match.

§

Doctype

Indicates that the parser has parsed the beginning of a document type definition (<!DOCTYPE).

§

BeforeDoctypeName

Indicates that the parser expects to parse the name of the document type definition next.

§

DoctypeName

Indicates that the parser is currently parsing the name of a document type definition, such as html in <!DOCTYPE html>.

§

AfterDoctypeName

Indicates that the parser has finished parsing the name of the document type definition and now optionally expects either a public or a system identifier.

§

AfterDoctypeKeyword(DoctypeKind)

Indicates that the parser has parsed a keyword for either a public or system identifier (PUBLIC or SYSTEM).

§

BeforeDoctypeIdentifier(DoctypeKind)

Indicates that the parser is about to parse the value of a public or system identifier within a document type definition, such as foo in <!DOCTYPE html PUBLIC "foo" "bar">.

§

DoctypeIdentifierDoubleQuoted(DoctypeKind)

Indicates that the parser is currently parsing the value of a public or system identifier that is surrounded by double quotes , such as foo in <!DOCTYPE html PUBLIC "foo" "bar">.

§

DoctypeIdentifierSingleQuoted(DoctypeKind)

Indicates that the parser is currently parsing the value of a public or system identifier that is surrounded by single quotes , such as foo in <!DOCTYPE html PUBLIC 'foo' 'bar'>.

§

AfterDoctypeIdentifier(DoctypeKind)

Indicates that the parser has finished parsing either a public or system identifier within a document type definition.

§

BetweenDoctypePublicAndSystemIdentifiers

Indicates that the parser has finished parsing a public identifier and now expects a system identifier.

§

BogusDoctype

Indicates that the parser is currently parsing an ill-formed document type defintion, such as <!DOCTYPE html what-is-this>.

§

BogusComment

Indicates that the parser is currently parsing an ill-formed comment, such as <? this is not what a comment should look like! >.

Trait Implementations§

Source§

impl Clone for XmlState

Source§

fn clone(&self) -> XmlState

Returns a duplicate 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 XmlState

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Hash for XmlState

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for XmlState

Source§

fn cmp(&self, other: &XmlState) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for XmlState

Source§

fn eq(&self, other: &XmlState) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for XmlState

Source§

fn partial_cmp(&self, other: &XmlState) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for XmlState

Source§

impl Eq for XmlState

Source§

impl StructuralPartialEq for XmlState

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.