#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe stylesheet, by its name in the bundle.
version: StringThe version of the rule set it implements.
sha256: StringThe SHA-256 of the stylesheet that ran.
findings: Vec<Finding>Its failed asserts and successful reports, in report order.
fired_rules: usizeThe 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
impl StylesheetReport
Sourcepub const fn svrl(&self) -> &CompactOutput
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.
Sourcepub fn canonical_svrl(&self) -> Result<String, Error>
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.