#[non_exhaustive]pub enum SyntaxError {
InvalidBangMarkup,
UnclosedPI,
UnclosedXmlDecl,
UnclosedComment,
UnclosedDoctype,
UnclosedCData,
UnclosedTag,
UnclosedSingleQuotedAttributeValue,
UnclosedDoubleQuotedAttributeValue,
}Expand description
An error returned when a parsed document does not conform to the XML grammar,
for example a tag opened by < that is not closed with >.
This error does not represent invalid XML constructs — for example the tags
<> and </> are well-formed from a syntactic point of view.
Marked #[non_exhaustive] so that adding a new syntax diagnostic in a future
release is not a breaking change for callers who match on this type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidBangMarkup
The parser started to parse <!, but the input ended before it could
recognize anything.
UnclosedPI
The parser started to parse a processing instruction (<?), but the input
ended before the ?> sequence was found.
UnclosedXmlDecl
The parser started to parse an XML declaration (<?xml followed by white
space or ?), but the input ended before the ?> sequence was found.
UnclosedComment
The parser started to parse a comment (<!--), but the input ended before
the --> sequence was found.
UnclosedDoctype
The parser started to parse a DTD (<!DOCTYPE), but the input ended before
the closing > character was found.
UnclosedCData
The parser started to parse <![CDATA[, but the input ended before the
]]> sequence was found.
UnclosedTag
The parser started to parse tag content, but the input ended before the
closing > character was found.
UnclosedSingleQuotedAttributeValue
The parser was inside a single-quoted attribute value, but the input ended before the closing quote was found.
UnclosedDoubleQuotedAttributeValue
The parser was inside a double-quoted attribute value, but the input ended before the closing quote was found.
Trait Implementations§
Source§impl Clone for SyntaxError
impl Clone for SyntaxError
impl Copy for SyntaxError
Source§impl Debug for SyntaxError
impl Debug for SyntaxError
Source§impl Display for SyntaxError
impl Display for SyntaxError
impl Eq for SyntaxError
Source§impl Error for SyntaxError
impl Error for SyntaxError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<SyntaxError> for Error
impl From<SyntaxError> for Error
Source§fn from(error: SyntaxError) -> Self
fn from(error: SyntaxError) -> Self
Creates a new Error::Syntax from the given error.