pub fn validate(
document: SourceDocument,
options: EnumSet<Options>,
) -> Result<ValidatedSourceDocument, SourceValidationError>Expand description
Validate a document with roas, skipping external references.
The result is the only way to obtain a ValidatedSourceDocument,
which is the only thing generation accepts — so the step cannot be
forgotten and cannot be bypassed. options is roas’s own set;
Options::IgnoreExternalReferences is always added, because the
validator would read a fetched document under the root’s version.
External references are reported by
ValidatedSourceDocument::diagnostics instead.
On failure the document comes back inside the error, so nothing the caller parsed is lost.