#[non_exhaustive]pub enum FileVerifyOutcome {
Match,
WholeMismatch {
expected: Vec<u8>,
actual: Vec<u8>,
},
BlockMismatches {
mismatched_blocks: Vec<usize>,
expected_block_count: usize,
actual_block_count: usize,
},
Missing,
IoError {
kind: ErrorKind,
message: String,
},
}Expand description
Per-file outcome of a HashVerifier::execute run.
#[non_exhaustive] so future outcome shapes (e.g. permission-denied vs
generic IO) can be split without a SemVer break.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Match
File matched the expected hash (whole-file mode) or every block matched (block-mode).
WholeMismatch
Whole-file mode: the computed digest did not equal the expected digest.
BlockMismatches
Block-mode: one or more blocks failed.
mismatched_blocks holds the zero-based indices of blocks whose hash
did not match, in ascending order. expected_block_count is the number
of block hashes the caller supplied. actual_block_count is the number
of blocks the file would contain at block_size (i.e. ceil(size / block_size)); a difference means the file is shorter or longer than
the caller’s expectation and every “extra” or “missing” block index is
reported in mismatched_blocks.
Fields
Missing
The file does not exist on disk.
IoError
An I/O error occurred while reading the file. kind is the
std::io::ErrorKind callers branch on (e.g. std::io::ErrorKind::PermissionDenied
to prompt for elevation, std::io::ErrorKind::NotFound is reported
as FileVerifyOutcome::Missing instead). message is the
std::io::Error Display rendering, preserved as a string so the
report stays Clone + PartialEq for downstream consumers.
Trait Implementations§
Source§impl Clone for FileVerifyOutcome
impl Clone for FileVerifyOutcome
Source§fn clone(&self) -> FileVerifyOutcome
fn clone(&self) -> FileVerifyOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FileVerifyOutcome
impl Debug for FileVerifyOutcome
Source§impl PartialEq for FileVerifyOutcome
impl PartialEq for FileVerifyOutcome
Source§fn eq(&self, other: &FileVerifyOutcome) -> bool
fn eq(&self, other: &FileVerifyOutcome) -> bool
self and other values to be equal, and is used by ==.impl Eq for FileVerifyOutcome
impl StructuralPartialEq for FileVerifyOutcome
Auto Trait Implementations§
impl Freeze for FileVerifyOutcome
impl RefUnwindSafe for FileVerifyOutcome
impl Send for FileVerifyOutcome
impl Sync for FileVerifyOutcome
impl Unpin for FileVerifyOutcome
impl UnsafeUnpin for FileVerifyOutcome
impl UnwindSafe for FileVerifyOutcome
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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