Skip to main content

EwfIntegrity

Struct EwfIntegrity 

Source
pub struct EwfIntegrity<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> EwfIntegrity<'a>

Source

pub fn new(data: &'a [u8]) -> Self

Analyse a single-segment E01 or Ex01 file.

Source

pub fn from_segments(segs: &[&'a [u8]]) -> Self

Analyse a multi-segment image. Pass segments in order: E01, E02, E03 …

Source

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).

Source

pub fn with_expected_sha1(self, hash: [u8; 20]) -> Self

Compare the computed SHA-1 against an externally-sourced reference. Mismatch → ExternalSha1Mismatch (Critical).

Source

pub fn with_expected_sha256(self, hash: [u8; 32]) -> Self

Compare the computed SHA-256 against an externally-sourced reference. Mismatch → ExternalSha256Mismatch (Critical).

Source

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.

Source

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).

Source

pub fn analyse(&self) -> Vec<EwfIntegrityAnomaly>

Source

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> 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, 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.