Skip to main content

StylesheetReport

Struct StylesheetReport 

Source
#[non_exhaustive]
pub struct StylesheetReport { pub name: String, pub version: String, pub sha256: String, pub findings: Vec<Finding>, pub fired_rules: usize, pub warnings: Vec<String>, pub failure: Option<StylesheetFailure>, /* private fields */ }
Expand description

What one stylesheet of the rule set reported on a document.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

The stylesheet, by its name in the bundle.

§version: String

The version of the rule set it implements.

§sha256: String

The SHA-256 of the stylesheet that ran.

§findings: Vec<Finding>

Its failed asserts and successful reports, in report order.

§fired_rules: usize

The number of rules that fired (its svrl:fired-rule elements): none means the stylesheet matched nothing in the document (a document of another syntax, …).

§warnings: Vec<String>

Recoverable conditions the transformation reported (ambiguous rule matches, dynamic errors raised while matching a pattern, after which the rule did not match), as the reference engine reports them: each distinct message once.

§failure: Option<StylesheetFailure>

The dynamic error that stopped the stylesheet, if it did not finish: then StylesheetReport::svrl is empty and there are no findings. This only happens in a report with schema errors (see Validator::validate_with).

Implementations§

Source§

impl StylesheetReport

Source

pub const fn svrl(&self) -> &CompactOutput

The SVRL report, exactly as the stylesheet wrote it: empty when the stylesheet did not finish.

It is kept compactly, each distinct piece of its text once (a compiled Schematron writes the same svrl:fired-rule element each time a rule fires): its text is made only when asked for, with CompactOutput::to_text, to_string() or written with {}; it compares equal to a &str.

Source

pub fn canonical_svrl(&self) -> Result<String, Error>

The SVRL report in the canonical text form of the einvoice-svrl crate (version 1, or 2 for a report with svrl:metadata), in which the document’s URI is written {document}: the form the expected results of the reference engine are stored in.

§Errors

Error::Transform when the stylesheet did not finish (there is no report); Error::Internal when the report holds something the canonical form cannot represent.

Trait Implementations§

Source§

impl Clone for StylesheetReport

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 Debug for StylesheetReport

Source§

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

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

impl Eq for StylesheetReport

Source§

impl PartialEq for StylesheetReport

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 StylesheetReport

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 = !

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.