Skip to main content

ErrorDomain

Enum ErrorDomain 

Source
#[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

Source§

fn clone(&self) -> ErrorDomain

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ErrorDomain

Source§

impl Debug for ErrorDomain

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for ErrorDomain

Source§

impl PartialEq for ErrorDomain

Source§

fn eq(&self, other: &ErrorDomain) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ErrorDomain

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.