pub struct ValidationReport {
pub ok_until: String,
pub truncated: Option<TruncationReason>,
}Expand description
Summary of a call to DIDWebVHState::validate.
Always carries the versionId of the last-known-good entry in ok_until.
If truncated is Some, entries past that point were dropped — see
TruncationReason for the two cases.
§Handling the report
// Strict: fail on any truncation (recommended for resolvers).
state.validate()?.assert_complete()?;
// Best-effort: accept partial logs, inspect truncation manually.
let report = state.validate()?;
if let Some(reason) = &report.truncated {
tracing::warn!(?reason, "partial validation");
}§On #[must_use]
The #[must_use] attribute catches the most obvious misuse —
state.validate(); as a bare statement — and forces a call-site
binding. It does not catch propagation-and-drop: state.validate()?;
still compiles cleanly, because ? consumes the Result and drops
the Ok(ValidationReport) without triggering the lint. Reach for
Self::assert_complete whenever you need the stricter “succeed only
if every loaded entry validated” contract — that is the one call that
turns truncation into an Err.
Fields§
§ok_until: StringversionId of the last log entry that validated successfully.
truncated: Option<TruncationReason>Some if some entries in the loaded log did not survive validation.
See TruncationReason for the variants (verification failure vs
post-deactivation tampering).
Implementations§
Source§impl ValidationReport
impl ValidationReport
Sourcepub fn assert_complete(self) -> Result<(), DIDWebVHError>
pub fn assert_complete(self) -> Result<(), DIDWebVHError>
Returns Err if the report indicates any truncation.
Convenience for the common “strict resolver” case — a caller that
wants Ok(()) only when every loaded entry validated can write
state.validate()?.assert_complete()?.
Trait Implementations§
Source§impl Clone for ValidationReport
impl Clone for ValidationReport
Source§fn clone(&self) -> ValidationReport
fn clone(&self) -> ValidationReport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more