Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error { Io { path: PathBuf, source: Error, }, Bundle { message: String, }, Checksum { path: String, expected: String, actual: String, }, NotXml { line: u32, column: u32, message: String, }, Unsupported { message: String, }, Transform { stylesheet: String, code: String, line: Option<u32>, message: String, }, Internal { message: String, }, }
Expand description

Why a rule set could not be loaded, or a document could not be validated.

Validity problems of a document (schema errors, failed asserts) are not errors: they are in the Report. An error means that no complete verdict could be given.

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.
§

Io

A file could not be read.

Fields

§path: PathBuf

The file.

§source: Error

The cause.

§

Bundle

The bundle is not usable: a manifest that does not follow the format, a missing file, an unknown schema name, a stylesheet that is not well-formed XSLT, or one whose result is not an SVRL report.

Fields

§message: String

What is wrong, naming the file and line when known.

§

Checksum

A file of the bundle does not have the SHA-256 its manifest records.

Fields

§path: String

The file, relative to the bundle.

§expected: String

The SHA-256 the manifest records (lower-case hexadecimal).

§actual: String

The SHA-256 of the file.

§

NotXml

The document is not well-formed XML (or not UTF-8, or not namespace-well-formed).

Fields

§line: u32

1-based line.

§column: u32

1-based column.

§message: String

The parser’s message.

§

Unsupported

The document or a rule-set artefact needs a construct that this engine does not implement (an encoding other than UTF-8, a document type declaration, an XSLT or XML Schema construct outside the supported subset). Refused rather than answered differently from the reference engine.

Fields

§message: String

What is not supported, and where.

§

Transform

A stylesheet of the rule set raised a dynamic error on the document (the reference engine fails on it as well).

Fields

§stylesheet: String

The stylesheet, by its name in the bundle.

§code: String

The XPath or XSLT error code (FORG0001, …).

§line: Option<u32>

The line of the stylesheet instruction, when known.

§message: String

The explanation.

§

Internal

A bug of this engine: a result it cannot read back.

Fields

§message: String

What went wrong.

Implementations§

Source§

impl Error

Source

pub const fn kind(&self) -> ErrorKind

The kind of the error.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Error

§

impl !UnwindSafe for Error

§

impl Forget for Error

§

impl Freeze for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

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> 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> 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.