pub struct Validation<'s, 'a> { /* private fields */ }Expand description
A validation in progress, given the events of a document one by one, in document
order, as einvoice_xml::Reader reads them: Schema::validation.
This is what Schema::validate does, for a caller that reads the document
itself, so that one pass over the text checks it for well-formedness (and for
anything else the caller wants to check) and validates it. The events must be
those of a reader of the text given to Schema::validation, every one of them,
up to the end of the document: the validation does not check well-formedness, and
the positions of its errors are byte offsets of that text. An event of a document
the reader then refuses, or a validation finished early, gives a report that
means nothing; it never panics.
Implementations§
Source§impl<'s, 'a> Validation<'s, 'a>
impl<'s, 'a> Validation<'s, 'a>
Sourcepub fn finish(self) -> Result<Report, DocumentError>
pub fn finish(self) -> Result<Report, DocumentError>
The report, once every event is given.
§Errors
DocumentError::Unsupported when the document needs a feature outside the
implemented subset (an xs:ENTITY value in a document with a document type declaration, whose
unparsed entities this crate does not read, or a value constraint of a
declaration taken as a value of a type valid only in a context): the first such element in document order.