pub enum Error {
IO(IOErrorWrapper),
InvalidUtf8Byte(u8),
InvalidChar(u32),
Xml(XmlError),
RestrictedXml(&'static str),
}
Expand description
Error types which may be returned from the parser or lexer.
With the exception of Error::IO
, all errors are fatal and will be returned indefinitely from the parser or lexer after the first encounter.
Variants§
IO(IOErrorWrapper)
An I/O error was encountered during lexing.
I/O errors are not fatal and may be retried. This is especially important for (but not limited to) std::io::ErrorKind::WouldBlock
errors.
Note: When an unexpected end-of-file situation is encountered during parsing or lexing, that is signalled using Error::Xml
instead of a std::io::ErrorKind::UnexpectedEof
error.
InvalidUtf8Byte(u8)
An invalid UTF-8 byte was encountered during decoding.
InvalidChar(u32)
An invalid Unicode scalar value was encountered during decoding.
Xml(XmlError)
A violation of the XML 1.0 grammar or a well-formedness or namespace-well-formedness constraint was encountered during parsing or lexing.
RestrictedXml(&'static str)
A forbidden construct was encountered during lexing or parsing.
The string indicates the context and should not be interpreted by user code.