async_zip/file/
mod.rs

1// Copyright (c) 2022 Harry [Majored] [hello@majored.pw]
2// MIT License (https://github.com/Majored/rs-async-zip/blob/main/LICENSE)
3
4use crate::{entry::StoredZipEntry, string::ZipString};
5
6/// An immutable store of data about a ZIP file.
7#[derive(Clone)]
8pub struct ZipFile {
9    pub(crate) entries: Vec<StoredZipEntry>,
10    pub(crate) zip64: bool,
11    pub(crate) comment: ZipString,
12}
13
14impl ZipFile {
15    /// Returns a list of this ZIP file's entries.
16    pub fn entries(&self) -> &[StoredZipEntry] {
17        &self.entries
18    }
19
20    /// Returns this ZIP file's trailing comment.
21    pub fn comment(&self) -> &ZipString {
22        &self.comment
23    }
24
25    /// Returns whether or not this ZIP file is zip64
26    pub fn zip64(&self) -> bool {
27        self.zip64
28    }
29}