#[non_exhaustive]pub enum IllFormedError {
MissingDeclVersion(Option<String>),
UnknownVersion,
MissingDoctypeName,
MissingEndTag(String),
UnmatchedEndTag(String),
MismatchedEndTag {
expected: String,
found: String,
},
DoubleHyphenInComment,
UnclosedReference,
}Expand description
An error returned when a parsed document is not well-formed, for example an opened tag that is not closed before the end of input.
These errors are not fatal: parsing can continue after encountering one.
Marked #[non_exhaustive] so that adding a new ill-formedness 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
MissingDeclVersion(Option<String>)
A version attribute was not found in an XML declaration or is not the
first attribute. Contains the name of the found attribute, if any.
UnknownVersion
The XML version specified in the declaration is neither 1.0 nor 1.1.
MissingDoctypeName
A document type definition (<!DOCTYPE foo>) does not contain a name.
MissingEndTag(String)
An end tag was not found while reading a sub-tree of elements because an EOF was encountered.
UnmatchedEndTag(String)
An end tag was encountered without a corresponding open tag at the same level of the hierarchy.
MismatchedEndTag
An end tag does not match the start tag at that nesting level.
Fields
DoubleHyphenInComment
A comment contains the forbidden double-hyphen (--) sequence.
UnclosedReference
The parser started to parse an entity or character reference (&...;), but
the input ended before the closing ; character was found.
Trait Implementations§
Source§impl Clone for IllFormedError
impl Clone for IllFormedError
Source§impl Debug for IllFormedError
impl Debug for IllFormedError
Source§impl Display for IllFormedError
impl Display for IllFormedError
impl Eq for IllFormedError
Source§impl Error for IllFormedError
impl Error for IllFormedError
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<IllFormedError> for Error
impl From<IllFormedError> for Error
Source§fn from(error: IllFormedError) -> Self
fn from(error: IllFormedError) -> Self
Creates a new Error::IllFormed from the given error.