#[repr(i32)]pub enum ErrorDomain {
Show 14 variants
None = 0,
Parser = 1,
Tree = 2,
Namespace = 3,
Dtd = 4,
Html = 5,
Io = 8,
XPath = 12,
Xslt = 22,
SchemasValidate = 17,
RelaxNGValidate = 19,
SchematronValidate = 28,
Validation = 23,
Encoding = 27,
}Expand description
Which subsystem raised the error.
Mirrors xmlErrorDomain from libxml2 (include/libxml/xmlerror.h) so that
errors can be categorised without inspecting the message string, AND so
that domain as i32 produces the exact numeric value a C caller sees
through xmlError::domain after going through the [crates/compat] FFI
shim. See thoughts/c_abi_implementation_plan.md § “Unified Rust error
type, free conversion to libxml2 layout.”
Variant discriminants are pinned — do not renumber — they are part of the C ABI surface.
Variants§
None = 0
No domain — used by libxml2 as the default value for fields it hasn’t initialised. We rarely emit this from Rust; included for round-trip.
Parser = 1
XML parser (well-formedness violations, unexpected tokens, etc.).
Tree = 2
Document tree manipulation.
Namespace = 3
Namespace resolution (undeclared prefix, duplicate declarations, etc.).
Dtd = 4
DTD processing and entity expansion.
Html = 5
HTML parsing errors (malformed tag soup, recovered errors from the HTML5 tree-construction algorithm).
Io = 8
I/O errors (file not found, read failure, etc.).
XPath = 12
XPath expression parsing or evaluation.
Xslt = 22
XSLT processing — stylesheet compile, transform errors.
SchemasValidate = 17
W3C XML Schema (XSD) validation. lxml’s error.domain_name →
"SCHEMASV".
RelaxNGValidate = 19
RELAX NG validation. lxml’s error.domain_name → "RELAXNGV".
SchematronValidate = 28
Schematron validation. lxml’s error.domain_name → "SCHEMATRONV".
Validation = 23
Schema or DTD validation.
Encoding = 27
Character encoding errors (invalid UTF-8, unsupported encoding). libxml2 calls this domain “I18N” but it’s the encoding/charset error bucket.
Trait Implementations§
Source§impl Clone for ErrorDomain
impl Clone for ErrorDomain
Source§fn clone(&self) -> ErrorDomain
fn clone(&self) -> ErrorDomain
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 ErrorDomain
Source§impl Debug for ErrorDomain
impl Debug for ErrorDomain
impl Eq for ErrorDomain
Source§impl PartialEq for ErrorDomain
impl PartialEq for ErrorDomain
Source§fn eq(&self, other: &ErrorDomain) -> bool
fn eq(&self, other: &ErrorDomain) -> bool
self and other values to be equal, and is used by ==.