#[non_exhaustive]pub enum XmlEncodingError {
UnsupportedByteEncoding(&'static str),
UnsupportedEncoding(String),
ConflictingEncoding(String),
MalformedDeclaration(&'static str),
InvalidBytes(&'static str),
MissingUtf16ByteOrder,
MissingUtf32ByteOrder,
MissingEncodingDeclaration(&'static str),
InvalidUtf16Length(&'static str),
InvalidUtf32Length(&'static str),
DecodedLimit {
maximum: usize,
actual: usize,
},
}Expand description
Shared decoder errors, including unsupported encodings and decoded-size limits. This replaces the former XML-only error variants rather than collapsing new failure classes into misleading legacy variants. Failure while converting external bytes into the Unicode XML parser contract.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UnsupportedByteEncoding(&'static str)
The byte signature selected an encoding that this implementation cannot decode.
UnsupportedEncoding(String)
An encoding label was not recognized.
ConflictingEncoding(String)
Resolver metadata, a byte signature, and the XML declaration disagreed.
MalformedDeclaration(&'static str)
The XML declaration was malformed before parsing could begin.
InvalidBytes(&'static str)
The selected decoder rejected malformed input instead of replacing it.
MissingUtf16ByteOrder
A BOM-less UTF-16 document did not identify its byte order.
MissingUtf32ByteOrder
A UTF-32 document did not identify its byte order through metadata or its signature.
MissingEncodingDeclaration(&'static str)
A non-UTF-8/UTF-16 entity omitted both external encoding metadata and its declaration.
InvalidUtf16Length(&'static str)
A UTF-16 code unit was truncated.
InvalidUtf32Length(&'static str)
A UTF-32 code unit was truncated.
DecodedLimit
Decoded UTF-8 would exceed the caller’s materialization ceiling.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()