async_zip/file/
builder.rs1use crate::{file::ZipFile, string::ZipString};
5
6pub struct ZipFileBuilder(pub(crate) ZipFile);
8
9impl From<ZipFile> for ZipFileBuilder {
10 fn from(file: ZipFile) -> Self {
11 Self(file)
12 }
13}
14
15impl Default for ZipFileBuilder {
16 fn default() -> Self {
17 ZipFileBuilder(ZipFile { entries: Vec::new(), zip64: false, comment: String::new().into() })
18 }
19}
20
21impl ZipFileBuilder {
22 pub fn new() -> Self {
23 Self::default()
24 }
25
26 pub fn comment(mut self, comment: ZipString) -> Self {
28 self.0.comment = comment;
29 self
30 }
31
32 pub fn build(self) -> ZipFile {
42 self.into()
43 }
44}