Skip to main content

IntegrityGaps

Struct IntegrityGaps 

Source
pub struct IntegrityGaps { /* private fields */ }
Expand description

What a requested integrity check left unverified.

The counts, the listed entries and the IntegrityIncomplete issue message all come from this one value, so they cannot disagree. Items that belong to no single entry (a TAR stream without an end marker) are only counted; entries past a fixed cap (256 today; rely on omitted, not the number) are counted in omitted instead of listed. The counts shape differs per surface: an iterator in Rust, a map in the CLI JSON, a dict in Python and an array of {reason, count} in Node.

§Examples

use exarch_core::DecompressionBudget;
use exarch_core::IntegrityCheck;
use exarch_core::SecurityConfig;
use exarch_core::VerificationOptions;
use exarch_core::verify_archive_with_options;

let options = VerificationOptions::default()
    .with_integrity(IntegrityCheck::DecodeToEof(DecompressionBudget::DEFAULT));
let report = verify_archive_with_options("a.7z", &SecurityConfig::default(), &options)?;
if let Some(gaps) = report.integrity_gaps() {
    for (reason, count) in gaps.counts() {
        println!("{reason}: {count}");
    }
}

Implementations§

Source§

impl IntegrityGaps

Source

pub fn counts(&self) -> impl Iterator<Item = (UnverifiedReason, u64)> + '_

Counts of unverified items per reason, in reason order; reasons with no items are absent.

Source

pub fn count(&self, reason: UnverifiedReason) -> u64

Number of items left unverified for reason.

Source

pub fn total(&self) -> u64

Total number of unverified items.

Source

pub fn is_empty(&self) -> bool

Returns true when nothing was left unverified.

Source

pub fn entries(&self) -> &[UnverifiedEntry]

The unverified entries that could be listed by path, up to a fixed cap; further ones are counted in omitted.

Source

pub const fn omitted(&self) -> u64

Number of unverified entries that had a path but were not listed because the list was full.

Trait Implementations§

Source§

impl Clone for IntegrityGaps

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IntegrityGaps

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for IntegrityGaps

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for IntegrityGaps

Source§

impl PartialEq for IntegrityGaps

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for IntegrityGaps

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.