Skip to main content

ErrorCode

Enum ErrorCode 

Source
#[non_exhaustive]
pub enum ErrorCode {
Show 26 variants Xpst0008, Xpst0017, Xpdy0002, Xpdy0050, Xpty0004, Xpty0018, Xpty0019, Xpty0020, Foar0001, Foar0002, Foca0002, Foch0001, Fodc0001, Fodt0001, Forg0001, Forg0006, Forx0001, Forx0002, Forx0003, Forx0004, Xtde1360, Xtde1390, Host, Unsupported, Internal, Limit,
}
Expand description

The error code of a failed compilation or evaluation.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Xpst0008

XPST0008: a variable that is not in scope (static).

§

Xpst0017

XPST0017: no function with that name and arity (static).

§

Xpdy0002

XPDY0002: the context item is absent.

§

Xpdy0050

XPDY0050: the root of the tree containing the context item is not a document node.

§

Xpty0004

XPTY0004: type error.

§

Xpty0018

XPTY0018: the last step of a path returns both nodes and atomic values.

§

Xpty0019

XPTY0019: a step of a path (other than the last) returns an atomic value.

§

Xpty0020

XPTY0020: the context item of an axis step is not a node.

§

Foar0001

FOAR0001: division by zero.

§

Foar0002

FOAR0002: numeric operation overflow.

§

Foca0002

FOCA0002: invalid lexical value.

§

Foch0001

FOCH0001: a code point that is not a valid XML character.

§

Fodc0001

FODC0001: no document node at the root of the tree (id()).

§

Fodt0001

FODT0001: date/time value out of range.

§

Forg0001

FORG0001: invalid value for a cast or constructor.

§

Forg0006

FORG0006: invalid argument type (effective boolean value, sum).

§

Forx0001

FORX0001: invalid regular expression flags.

§

Forx0002

FORX0002: invalid regular expression.

§

Forx0003

FORX0003: the regular expression matches a zero-length string.

§

Forx0004

FORX0004: invalid replacement string.

§

Xtde1360

XTDE1360: current() where no current item exists (XSLT).

§

Xtde1390

XTDE1390: the argument of system-property() is not a valid QName (XSLT).

§

Host

An error reported by the host (the XSLT layer): variables, user functions, document(). The code is in the message.

§

Unsupported

Not an XPath error: a valid construct or value that this crate refuses on purpose rather than evaluating it differently from the reference engine.

§

Internal

Not an XPath error: a broken invariant of this crate (a bug).

§

Limit

Not an XPath error: the evaluation went beyond a limit that keeps it within a bounded call stack (Error::limit).

Implementations§

Source§

impl ErrorCode

Source

pub const fn as_str(self) -> &'static str

The code as written in the specifications, e.g. "XPTY0004".

Source

pub const fn is_static(self) -> bool

Whether the error is raised when an expression is compiled rather than evaluated.

Trait Implementations§

Source§

impl Clone for ErrorCode

Source§

fn clone(&self) -> Self

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 ErrorCode

Source§

impl Debug for ErrorCode

Source§

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

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

impl Display for ErrorCode

Source§

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

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

impl Eq for ErrorCode

Source§

impl Hash for ErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ErrorCode

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ErrorCode

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.