pub struct EwfIntegrity<'a> { /* private fields */ }Implementations§
Source§impl<'a> EwfIntegrity<'a>
impl<'a> EwfIntegrity<'a>
Sourcepub fn from_segments(segs: &[&'a [u8]]) -> Self
pub fn from_segments(segs: &[&'a [u8]]) -> Self
Analyse a multi-segment image. Pass segments in order: E01, E02, E03 …
Sourcepub fn with_expected_md5(self, hash: [u8; 16]) -> Self
pub fn with_expected_md5(self, hash: [u8; 16]) -> Self
Compare the computed MD5 against an externally-sourced reference
(e.g., a chain-of-custody form). Mismatch → ExternalMd5Mismatch (Critical).
Sourcepub fn with_expected_sha1(self, hash: [u8; 20]) -> Self
pub fn with_expected_sha1(self, hash: [u8; 20]) -> Self
Compare the computed SHA-1 against an externally-sourced reference.
Mismatch → ExternalSha1Mismatch (Critical).
Sourcepub fn with_expected_sha256(self, hash: [u8; 32]) -> Self
pub fn with_expected_sha256(self, hash: [u8; 32]) -> Self
Compare the computed SHA-256 against an externally-sourced reference.
Mismatch → ExternalSha256Mismatch (Critical).
Sourcepub fn header_metadata(&self) -> Option<EwfHeaderMetadata>
pub fn header_metadata(&self) -> Option<EwfHeaderMetadata>
Parse the zlib-compressed acquisition metadata from the header section.
Returns Some on the first segment that contains a valid, decompressible
header section with a parseable key-value block. Returns None if no
such section exists or any parse step fails.
Sourcepub fn compute_hashes(&self) -> Option<ComputedHashes>
pub fn compute_hashes(&self) -> Option<ComputedHashes>
Compute MD5, SHA-1, and SHA-256 of all sector data without verifying stored hashes.
Returns None if the image is unparseable (too short, invalid signature,
missing geometry, or no chunk table found in an EWF v2 image).
pub fn analyse(&self) -> Vec<EwfIntegrityAnomaly>
Sourcepub fn analyse_with_progress(
&self,
progress: impl FnMut(AnalysisProgress),
) -> Vec<EwfIntegrityAnomaly>
pub fn analyse_with_progress( &self, progress: impl FnMut(AnalysisProgress), ) -> Vec<EwfIntegrityAnomaly>
Analyse with a per-chunk progress callback.
The callback receives an AnalysisProgress snapshot after each chunk
is processed. The final call has chunks_done == chunks_total (for
EWF v2) or chunks_done > 0 (for EWF v1).
Returns the same anomaly list as analyse.