pub async fn close(mut self) -> Result<()> {
        let cd_offset = self.writer.offset();

        for entry in &self.cd_entries {
            self.writer.write_all(&crate::spec::delimiter::CDFHD.to_le_bytes()).await?;
            self.writer.write_all(&entry.header.to_slice()).await?;
            self.writer.write_all(entry.opts.filename.as_bytes()).await?;
            self.writer.write_all(&entry.opts.extra).await?;
            self.writer.write_all(entry.opts.comment.as_bytes()).await?;
        }

        let header = EndOfCentralDirectoryHeader {
            disk_num: 0,
            start_cent_dir_disk: 0,
            num_of_entries_disk: self.cd_entries.len() as u16,
            num_of_entries: self.cd_entries.len() as u16,
            size_cent_dir: (self.writer.offset() - cd_offset) as u32,
            cent_dir_offset: cd_offset as u32,
            file_comm_length: self.comment_opt.as_ref().map(|v| v.len() as u16).unwrap_or_default(),
        };

        self.writer.write_all(&crate::spec::delimiter::EOCDD.to_le_bytes()).await?;
        self.writer.write_all(&header.to_slice()).await?;
        if let Some(comment) = self.comment_opt {
            self.writer.write_all(comment.as_bytes()).await?;
        }

        Ok(())
    }
/// Consumes this ZIP writer and completes all closing tasks.
///
/// This includes:
/// - Writing all central directroy headers.
/// - Writing the end of central directory header.
/// - Writing the file comment.
///
/// Failiure to call this function before going out of scope would result in a corrupted ZIP file.
Consumes this ZIP writer and completes all closing tasks.
This includes:
Writing all central directroy headers.
Writing the end of central directory header.
Writing the file comment.

Failiure to call this function before going out of scope would result in a corrupted ZIP file.
Consumes this ZIP writer and completes all closing tasks . This includes : Writing all central directroy headers . Writing the end of central directory header . Writing the file comment . Failiure to call this function before going out of scope would result in a corrupted ZIP file .
pub async fn close(mut self) -> Result<()> {
        let cd_offset = self.writer.offset();
        for entry in &self.cd_entries {
            self.writer.write_all(&crate::spec::delimiter::CDFHD.to_le_bytes()).await?;
            self.writer.write_all(&entry.header.to_slice()).await?;
            self.writer.write_all(entry.opts.filename.as_bytes()).await?;
            self.writer.write_all(&entry.opts.extra).await?;
            self.writer.write_all(entry.opts.comment.as_bytes()).await?;
        }
        let header = EndOfCentralDirectoryHeader {
            disk_num: 0,
            start_cent_dir_disk: 0,
            num_of_entries_disk: self.cd_entries.len() as u16,
            num_of_entries: self.cd_entries.len() as u16,
            size_cent_dir: (self.writer.offset() - cd_offset) as u32,
            cent_dir_offset: cd_offset as u32,
            file_comm_length: self.comment_opt.as_ref().map(|v| v.len() as u16).unwrap_or_default(),
        };
        self.writer.write_all(&crate::spec::delimiter::EOCDD.to_le_bytes()).await?;
        self.writer.write_all(&header.to_slice()).await?;
        if let Some(comment) = self.comment_opt {
            self.writer.write_all(comment.as_bytes()).await?;
        }
        Ok(())
    }
pub async fn close ( mut self ) -> Result < ( ) > { let cd_offset = self . writer . offset ( ) ; for entry in & self . cd_entries { self . writer . write_all ( & crate :: spec :: delimiter :: CDFHD . to_le_bytes ( ) ) . await ? ; self . writer . write_all ( & entry . header . to_slice ( ) ) . await ? ; self . writer . write_all ( entry . opts . filename . as_bytes ( ) ) . await ? ; self . writer . write_all ( & entry . opts . extra ) . await ? ; self . writer . write_all ( entry . opts . comment . as_bytes ( ) ) . await ? ; } let header = EndOfCentralDirectoryHeader { disk_num : 0 , start_cent_dir_disk : 0 , num_of_entries_disk : self . cd_entries . len ( ) as u16 , num_of_entries : self . cd_entries . len ( ) as u16 , size_cent_dir : ( self . writer . offset ( ) - cd_offset ) as u32 , cent_dir_offset : cd_offset as u32 , file_comm_length : self . comment_opt . as_ref ( ) . map ( | v | v . len ( ) as u16 ) . unwrap_or_default ( ) , } ; self . writer . write_all ( & crate :: spec :: delimiter :: EOCDD . to_le_bytes ( ) ) . await ? ; self . writer . write_all ( & header . to_slice ( ) ) . await ? ; if let Some ( comment ) = self . comment_opt { self . writer . write_all ( comment . as_bytes ( ) ) . await ? ; } Ok ( ( ) ) }
Consumes this ZIP writer and completes all closing tasks.
Consumes this ZIP writer and completes all closing tasks .
mut self
mut self