Skip to main content

VerifyOptions

Struct VerifyOptions 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: bool

Opt-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

Source§

fn default() -> VerifyOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more