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.
Auto Trait Implementations§
impl<'a> Freeze for EwfIntegrity<'a>
impl<'a> RefUnwindSafe for EwfIntegrity<'a>
impl<'a> Send for EwfIntegrity<'a>
impl<'a> Sync for EwfIntegrity<'a>
impl<'a> Unpin for EwfIntegrity<'a>
impl<'a> UnsafeUnpin for EwfIntegrity<'a>
impl<'a> UnwindSafe for EwfIntegrity<'a>
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> 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