#[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 ==.