pub struct ArchiveManifest {
pub format: ArchiveEncoding,
pub entries: Vec<ArchiveEntry>,
}Expand description
A normalized listing of archive entries.
Fields§
§format: ArchiveEncodingArchive and compression format metadata.
entries: Vec<ArchiveEntry>Normalized archive entry listing.
Implementations§
Source§impl ArchiveManifest
impl ArchiveManifest
Sourcepub const fn new(format: ArchiveEncoding) -> ArchiveManifest
pub const fn new(format: ArchiveEncoding) -> ArchiveManifest
Creates an empty manifest for an archive encoding.
Sourcepub fn with_entries(self, entries: Vec<ArchiveEntry>) -> ArchiveManifest
pub fn with_entries(self, entries: Vec<ArchiveEntry>) -> ArchiveManifest
Adds an entry listing to the manifest.
Sourcepub fn push_entry(&mut self, entry: ArchiveEntry)
pub fn push_entry(&mut self, entry: ArchiveEntry)
Appends one entry to the manifest.
Sourcepub const fn format(&self) -> ArchiveEncoding
pub const fn format(&self) -> ArchiveEncoding
Returns the archive encoding metadata.
Sourcepub fn entries(&self) -> &[ArchiveEntry]
pub fn entries(&self) -> &[ArchiveEntry]
Returns the manifest entries.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Returns the number of entries.
Sourcepub fn total_size(&self) -> u64
pub fn total_size(&self) -> u64
Returns the sum of all known entry sizes.
Sourcepub fn known_size_count(&self) -> usize
pub fn known_size_count(&self) -> usize
Returns the number of entries with known sizes.
Sourcepub fn file_count(&self) -> usize
pub fn file_count(&self) -> usize
Returns the number of regular file entries.
Sourcepub fn directory_count(&self) -> usize
pub fn directory_count(&self) -> usize
Returns the number of directory entries.
Sourcepub fn symlink_count(&self) -> usize
pub fn symlink_count(&self) -> usize
Returns the number of symbolic link entries.
Sourcepub fn has_unsafe_paths(&self) -> bool
pub fn has_unsafe_paths(&self) -> bool
Returns whether any entry path is unsafe for relative extraction.
Sourcepub fn unsafe_paths(&self) -> Vec<&ArchiveEntry>
pub fn unsafe_paths(&self) -> Vec<&ArchiveEntry>
Returns entries whose paths are unsafe for relative extraction.
Sourcepub fn extensions(&self) -> Vec<String>
pub fn extensions(&self) -> Vec<String>
Returns sorted, deduplicated lowercase entry extensions.
Trait Implementations§
Source§impl Clone for ArchiveManifest
impl Clone for ArchiveManifest
Source§fn clone(&self) -> ArchiveManifest
fn clone(&self) -> ArchiveManifest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ArchiveManifest
impl Debug for ArchiveManifest
Source§impl Default for ArchiveManifest
impl Default for ArchiveManifest
Source§fn default() -> ArchiveManifest
fn default() -> ArchiveManifest
Returns the “default value” for a type. Read more
Source§impl PartialEq for ArchiveManifest
impl PartialEq for ArchiveManifest
impl Eq for ArchiveManifest
impl StructuralPartialEq for ArchiveManifest
Auto Trait Implementations§
impl Freeze for ArchiveManifest
impl RefUnwindSafe for ArchiveManifest
impl Send for ArchiveManifest
impl Sync for ArchiveManifest
impl Unpin for ArchiveManifest
impl UnsafeUnpin for ArchiveManifest
impl UnwindSafe for ArchiveManifest
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
Mutably borrows from an owned value. Read more