pub enum SyntaxError {
InvalidBangMarkup,
UnclosedPI,
UnclosedXmlDecl,
UnclosedComment,
UnclosedDoctype,
UnclosedCData,
UnclosedTag,
UnclosedSingleQuotedAttributeValue,
UnclosedDoubleQuotedAttributeValue,
}Expand description
An error returned if parsed document does not correspond to the XML grammar,
for example, a tag opened by < not closed with >. This error does not
represent invalid XML constructs, for example, tags <> and </> a well-formed
from syntax point-of-view.
Variants§
InvalidBangMarkup
The parser started to parse <!, but the input ended before it can recognize
anything.
UnclosedPI
The parser started to parse processing instruction (<?),
but the input ended before the ?> sequence was found.
UnclosedXmlDecl
The parser started to parse XML declaration (<?xml followed by \t, \r, \n, or ?),
but the input ended before the ?> sequence was found.
UnclosedComment
The parser started to parse comment (<!--) content, but the input ended
before the --> sequence was found.
UnclosedDoctype
The parser started to parse DTD (<!DOCTYPE) content, but the input ended
before the closing > character was found.
UnclosedCData
The parser started to parse <![CDATA[ content, 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 started to parse tag content and currently inside of a quoted string (i.e. in an attribute value), but the input ended before the closing quote was found.
Note, that currently error location will point to a start of a tag (the < character)
instead of a start of an attribute value.
UnclosedDoubleQuotedAttributeValue
The parser started to parse tag content and currently inside of a quoted string (i.e. in an attribute value), but the input ended before the closing quote was found.
Note, that currently error location will point to a start of a tag (the < character)
instead of a start of an attribute value.
Trait Implementations§
Source§impl Clone for SyntaxError
impl Clone for SyntaxError
Source§fn clone(&self) -> SyntaxError
fn clone(&self) -> SyntaxError
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 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
Source§impl PartialEq for SyntaxError
impl PartialEq for SyntaxError
Source§fn eq(&self, other: &SyntaxError) -> bool
fn eq(&self, other: &SyntaxError) -> bool
self and other values to be equal, and is used by ==.