pub enum ParseError {
Show 14 variants
UnclosedTag(Span),
InvalidCloseTag(String, String, Span),
UnclosedEntity(String, usize),
InvalidEntity(String, Span),
UnknownPrefix(String, Span),
DuplicateAttribute(String, Span),
UnsupportedVersion(String, Span),
UnsupportedNotStandalone(Span),
DtdUnsupported(Span),
NoElementAtTopLevel(usize),
MultipleElementsAtTopLevel(Span),
TextAtTopLevel(Span),
DuplicateId(String, Span),
XmlParser(Error, usize),
}
Expand description
An error that occurred during parsing.
Variants§
UnclosedTag(Span)
The XML is not well-formed - a tag is opened and never closed.
InvalidCloseTag(String, String, Span)
The XML is not well-formed - a tag is closed that was never opened.
UnclosedEntity(String, usize)
The XML is not well-formed - you use &
to open an entity without
closing it with ;
.
InvalidEntity(String, Span)
The entity is not known. Only the basic entities are supported right now, not any user defined ones.
UnknownPrefix(String, Span)
You used a namespace prefix that is not declared during parsing.
DuplicateAttribute(String, Span)
You declared an attribute of the same name twice.
UnsupportedVersion(String, Span)
Unsupported XML version. Only 1.0 is supported.
UnsupportedNotStandalone(Span)
Unsupported standalone declaration. This error is deprecated since version 0.29, and both “yes” and “no” values are accepted for the standalone declaration.
DtdUnsupported(Span)
XML DTD is not supported.
NoElementAtTopLevel(usize)
No top-level element in the document.
MultipleElementsAtTopLevel(Span)
Multiple top-level elements in the document.
TextAtTopLevel(Span)
Text at top level is not allowed in a well-formed document.
DuplicateId(String, Span)
Duplicate xml:id is not allowed
XmlParser(Error, usize)
xmlparser error
Implementations§
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
Source§fn description(&self) -> &str
fn description(&self) -> &str
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more