#[non_exhaustive]pub struct VerifyOptions {
pub cancel: Option<CancellationToken>,
pub progress: Option<ProgressCallback>,
pub proven_slices: HashMap<FileId, Vec<bool>>,
pub fast_verify: bool,
}Expand description
Options controlling verification behavior.
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.cancel: Option<CancellationToken>If set, verification will check this token and stop early if cancelled.
progress: Option<ProgressCallback>If set, called with progress updates after each file is verified.
proven_slices: HashMap<FileId, Vec<bool>>Per-file slices the caller has already proven, keyed by FileId.
Each vector is one entry per slice of that file, in the set’s slice
order and of exactly the length the set’s layout gives that file —
the same shape as FileVerification::valid_slices, so a caller can
feed back what an earlier pass produced. true means “this slice is
proven intact and need not be read”; false means “say nothing about
it”, which is what an entirely absent entry means for every slice.
Verification then reads only the unproven slices, seeking over the
byte ranges the proven ones cover, and reports a result shaped exactly
as a full read would have: per-slice accounting is exact, and the file
is Complete only when every one of its slices is accounted for by
evidence or by a read that matched.
§Trust contract
This is caller-attested and is not re-derived. A wrong attestation
produces a false Complete for the slices it covers — verification
reads nothing that could contradict it. That is the same trust class
as the crate’s other evidence paths: what a caller vouches for, it
vouches for. Attest only slices whose bytes you checksummed against
this set’s own per-slice checksums, on a file that is no longer being
written.
§When it is ignored
Evidence applies only where a per-slice verdict can mean anything: the file must exist, its on-disk length must equal the description’s, it must carry a complete IFSC checksum set, and it must be non-empty. A file failing any of those takes the pipeline it always took, evidence or no evidence — in particular, evidence about a missing file does not resurrect it, and evidence about a file whose length no longer matches is discarded rather than believed, because the offsets those verdicts were about are not the offsets in the file now on disk. A vector of the wrong length is ignored in full for the same reason.
An entry that proves nothing (all false) is treated as absent, so an
empty or all-false map leaves verification byte-for-byte what it was.
fast_verify: boolOpt-in fast-verify mode (default false). When enabled, an intact
candidate file whose on-disk length already matches the description is
proven complete from its per-slice IFSC checksums (CRC32 + MD5, tail
slice zero-padded) scanned span-parallel at read speed, skipping the
inherently serial full-file MD5. Off by default, in which case
verification is byte-identical to the strict full-MD5 pipeline. The
WEAVER_PAR2_FAST_VERIFY environment variable overrides this per verify
call, taking precedence over whatever is set here.
Trait Implementations§
Source§impl Default for VerifyOptions
impl Default for VerifyOptions
Source§fn default() -> VerifyOptions
fn default() -> VerifyOptions
Auto Trait Implementations§
impl !RefUnwindSafe for VerifyOptions
impl !UnwindSafe for VerifyOptions
impl Freeze for VerifyOptions
impl Send for VerifyOptions
impl Sync for VerifyOptions
impl Unpin for VerifyOptions
impl UnsafeUnpin for VerifyOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more