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
impl IntegrityGaps
Sourcepub fn counts(&self) -> impl Iterator<Item = (UnverifiedReason, u64)> + '_
pub fn counts(&self) -> impl Iterator<Item = (UnverifiedReason, u64)> + '_
Counts of unverified items per reason, in reason order; reasons with no items are absent.
Sourcepub fn count(&self, reason: UnverifiedReason) -> u64
pub fn count(&self, reason: UnverifiedReason) -> u64
Number of items left unverified for reason.
Sourcepub fn entries(&self) -> &[UnverifiedEntry]
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.
Trait Implementations§
Source§impl Clone for IntegrityGaps
impl Clone for IntegrityGaps
Source§impl Debug for IntegrityGaps
impl Debug for IntegrityGaps
Source§impl Default for IntegrityGaps
impl Default for IntegrityGaps
impl Eq for IntegrityGaps
Source§impl PartialEq for IntegrityGaps
impl PartialEq for IntegrityGaps
impl StructuralPartialEq for IntegrityGaps
Auto Trait Implementations§
impl Freeze for IntegrityGaps
impl RefUnwindSafe for IntegrityGaps
impl Send for IntegrityGaps
impl Sync for IntegrityGaps
impl Unpin for IntegrityGaps
impl UnsafeUnpin for IntegrityGaps
impl UnwindSafe for IntegrityGaps
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.