#[non_exhaustive]pub enum ParseErrorKind {
Show 65 variants
CdataInHtmlContent,
IncorrectlyOpenedComment,
AbruptClosingOfEmptyComment,
NestedComment,
IncorrectlyClosedComment,
EofInComment,
InvalidFirstCharacterOfTagName,
EofBeforeTagName,
MissingEndTagName,
EofInTag,
EndTagWithAttributes,
EndTagWithTrailingSolidus,
DuplicateAttribute,
UnexpectedNullCharacter,
UnexpectedCharacterInAttributeName,
MissingAttributeValue,
UnexpectedCharacterInUnquotedAttributeValue,
MissingWhitespaceBetweenAttributes,
UnexpectedSolidusInTag,
UnexpectedEqualsSignBeforeAttributeName,
UnknownNamedCharacterReference,
AbsenceOfDigitsInNumericCharacterReference,
MissingSemicolonAfterCharacterReference,
NullCharacterReference,
CharacterReferenceOutsideUnicodeRange,
SurrogateCharacterReference,
NoncharacterCharacterReference,
ControlCharacterReference,
MissingWhitespaceBeforeDoctypeName,
MissingDoctypeName,
InvalidCharacterSequenceAfterDoctypeName,
MissingWhitespaceAfterDoctypePublicKeyword,
MissingWhitespaceAfterDoctypeSystemKeyword,
MissingDoctypePublicIdentifier,
MissingDoctypeSystemIdentifier,
MissingQuoteBeforeDoctypePublicIdentifier,
MissingQuoteBeforeDoctypeSystemIdentifier,
AbruptDoctypePublicIdentifier,
AbruptDoctypeSystemIdentifier,
MissingWhitespaceBetweenDoctypePublicAndSystemIdentifiers,
UnexpectedCharacterAfterDoctypeSystemIdentifier,
EofInDoctype,
EofInProcessingInstruction,
InvalidFirstCharacterOfProcessingInstructionTarget,
InvalidProcessingInstructionTarget,
DisallowedProcessingInstructionTarget,
EofInScriptHtmlCommentLikeText,
EofInCdata,
NoncharacterInInputStream,
ControlCharacterInInputStream,
ImpliedEndTagWithUnclosedElements,
EndTagPWithoutPInButtonScope,
StrayEndTag,
EndTagBr,
NonVoidHtmlElementStartTagWithTrailingSolidus,
EofWithUnclosedElements,
EofInTextMode,
StartTagImage,
NestedForm,
StartTagTableInTable,
MisplacedTokenInTable,
NonSpaceCharactersInTable,
StrayEndTagInTable,
TokenAfterBody,
StrayDoctype,
}Expand description
Which WHATWG “parse error” (§13.2.2) occurred. Variant names mirror
the spec’s own kebab-case error identifiers, translated to
PascalCase. Only variants this crate actually detects and reports
exist — no catch-all/string-payload variant, so matching on a
specific kind stays meaningful. #[non_exhaustive] because more
variants may still be added: the tokenizer level (§13.2.5,
plan/07-parse-errors.md) is complete at 50 of the 52 named errors,
but the tree-construction level (§13.2.6,
plan/08-tree-construction-errors.md) covers only the conditions
with a demonstrated consumer need, not all of §13.2.6’s unnamed
ones — adding one later must not be a breaking change for any caller
matching on this type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CdataInHtmlContent
IncorrectlyOpenedComment
AbruptClosingOfEmptyComment
NestedComment
IncorrectlyClosedComment
EofInComment
InvalidFirstCharacterOfTagName
EofBeforeTagName
MissingEndTagName
EofInTag
EndTagWithAttributes
EndTagWithTrailingSolidus
DuplicateAttribute
UnexpectedNullCharacter
UnexpectedCharacterInAttributeName
MissingAttributeValue
UnexpectedCharacterInUnquotedAttributeValue
MissingWhitespaceBetweenAttributes
UnexpectedSolidusInTag
UnexpectedEqualsSignBeforeAttributeName
UnknownNamedCharacterReference
AbsenceOfDigitsInNumericCharacterReference
MissingSemicolonAfterCharacterReference
NullCharacterReference
CharacterReferenceOutsideUnicodeRange
SurrogateCharacterReference
NoncharacterCharacterReference
ControlCharacterReference
MissingWhitespaceBeforeDoctypeName
MissingDoctypeName
InvalidCharacterSequenceAfterDoctypeName
MissingWhitespaceAfterDoctypePublicKeyword
MissingWhitespaceAfterDoctypeSystemKeyword
MissingDoctypePublicIdentifier
MissingDoctypeSystemIdentifier
MissingQuoteBeforeDoctypePublicIdentifier
MissingQuoteBeforeDoctypeSystemIdentifier
AbruptDoctypePublicIdentifier
AbruptDoctypeSystemIdentifier
MissingWhitespaceBetweenDoctypePublicAndSystemIdentifiers
UnexpectedCharacterAfterDoctypeSystemIdentifier
EofInDoctype
EofInProcessingInstruction
InvalidFirstCharacterOfProcessingInstructionTarget
InvalidProcessingInstructionTarget
DisallowedProcessingInstructionTarget
EofInScriptHtmlCommentLikeText
EofInCdata
NoncharacterInInputStream
ControlCharacterInInputStream
ImpliedEndTagWithUnclosedElements
EndTagPWithoutPInButtonScope
StrayEndTag
EndTagBr
NonVoidHtmlElementStartTagWithTrailingSolidus
EofWithUnclosedElements
EofInTextMode
StartTagImage
NestedForm
StartTagTableInTable
MisplacedTokenInTable
NonSpaceCharactersInTable
StrayEndTagInTable
TokenAfterBody
StrayDoctype
Trait Implementations§
Source§impl Clone for ParseErrorKind
impl Clone for ParseErrorKind
Source§fn clone(&self) -> ParseErrorKind
fn clone(&self) -> ParseErrorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ParseErrorKind
Source§impl Debug for ParseErrorKind
impl Debug for ParseErrorKind
Source§impl Display for ParseErrorKind
impl Display for ParseErrorKind
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
A short, human-readable description — not a transcription of any
particular consumer’s exact wording (e.g. not vnu’s), just a
plain-English description of the WHATWG condition this variant
names. Consumers that need their own phrasing should match on
ParseErrorKind directly instead of parsing this string.