| 1 | // Copyright (c) 2021 Harry [Majored] [[email protected]] |
| 2 | // MIT License (https://github.com/Majored/rs-async-zip/blob/main/LICENSE) |
| 3 | |
| 4 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::borrowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/::Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#; |
| 5 | |
| 6 | use craterust-analyzer cargo async_zip 0.0.18 crate/::baserust-analyzer cargo async_zip 0.0.18 base/::writerust-analyzer cargo async_zip 0.0.18 base/write/::get_or_put_info_zip_unicode_comment_extra_field_mutrust-analyzer cargo async_zip 0.0.18 base/write/get_or_put_info_zip_unicode_comment_extra_field_mut().; |
| 7 | use craterust-analyzer cargo async_zip 0.0.18 crate/::baserust-analyzer cargo async_zip 0.0.18 base/::writerust-analyzer cargo async_zip 0.0.18 base/write/::get_or_put_info_zip_unicode_path_extra_field_mutrust-analyzer cargo async_zip 0.0.18 base/write/get_or_put_info_zip_unicode_path_extra_field_mut().; |
| 8 | use craterust-analyzer cargo async_zip 0.0.18 crate/::baserust-analyzer cargo async_zip 0.0.18 base/::writerust-analyzer cargo async_zip 0.0.18 base/write/::{CentralDirectoryEntryrust-analyzer cargo async_zip 0.0.18 base/write/CentralDirectoryEntry#, ZipFileWriterrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#}; |
| 9 | use craterust-analyzer cargo async_zip 0.0.18 crate/::entryrust-analyzer cargo async_zip 0.0.18 entry/::ZipEntryrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#; |
| 10 | use craterust-analyzer cargo async_zip 0.0.18 crate/::errorrust-analyzer cargo async_zip 0.0.18 error/::{Resultrust-analyzer cargo async_zip 0.0.18 error/Result#, Zip64ErrorCaserust-analyzer cargo async_zip 0.0.18 error/Zip64ErrorCase#, ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#}; |
| 11 | use craterust-analyzer cargo async_zip 0.0.18 crate/::specrust-analyzer cargo async_zip 0.0.18 spec/::extra_fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/::Zip64ExtendedInformationExtraFieldBuilderrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#; |
| 12 | use craterust-analyzer cargo async_zip 0.0.18 crate/::specrust-analyzer cargo async_zip 0.0.18 spec/::headerrust-analyzer cargo async_zip 0.0.18 spec/header/::{InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#, InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#}; |
| 13 | use craterust-analyzer cargo async_zip 0.0.18 crate/::specrust-analyzer cargo async_zip 0.0.18 spec/::{ |
| 14 | extra_fieldrust-analyzer cargo async_zip 0.0.18 spec/extra_field/::ExtraFieldAsBytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/ExtraFieldAsBytes#, |
| 15 | headerrust-analyzer cargo async_zip 0.0.18 spec/header/::{CentralDirectoryRecordrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#, ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#, GeneralPurposeFlagrust-analyzer cargo async_zip 0.0.18 spec/header/GeneralPurposeFlag#, LocalFileHeaderrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#}, |
| 16 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#, |
| 17 | }; |
| 18 | use craterust-analyzer cargo async_zip 0.0.18 crate/::StringEncodingrust-analyzer cargo async_zip 0.0.18 string/StringEncoding#; |
| 19 | #[cfg(any(feature = "deflate", feature = "bzip2", feature = "zstd", feature = "lzma", feature = "xz"))] |
| 20 | use futures_literust-analyzer cargo futures-lite 2.1.0 crate/::iorust-analyzer cargo futures-lite 2.1.0 io/::Cursorrust-analyzer cargo futures-lite 2.1.0 io/Cursor#; |
| 21 | |
| 22 | use craterust-analyzer cargo async_zip 0.0.18 crate/::specrust-analyzer cargo async_zip 0.0.18 spec/::constsrust-analyzer cargo async_zip 0.0.18 spec/consts/::{NON_ZIP64_MAX_NUM_FILESrust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_NUM_FILES., NON_ZIP64_MAX_SIZErust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_SIZE.}; |
| 23 | #[cfg(any(feature = "deflate", feature = "bzip2", feature = "zstd", feature = "lzma", feature = "xz"))] |
| 24 | use async_compressionrust-analyzer cargo async-compression 0.4.27 crate/::futuresrust-analyzer cargo async-compression 0.4.27 futures/::writerust-analyzer cargo async-compression 0.4.27 futures/write/; |
| 25 | use futures_literust-analyzer cargo futures-lite 2.1.0 crate/::iorust-analyzer cargo futures-lite 2.1.0 io/::{AsyncWriterust-analyzer cargo futures-io 0.3.25 if_std/AsyncWrite#, AsyncWriteExtrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#}; |
| 26 | |
| 27 | pub struct EntryWholeWriterrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#<'b, 'c, W: AsyncWriterust-analyzer cargo futures-io 0.3.25 if_std/AsyncWrite# + Unpinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Unpin#> { |
| 28 | writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer.: &'b mut ZipFileWriterrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#<W>, |
| 29 | entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry.: ZipEntryrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#, |
| 30 | datarust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#data.: Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'c, [u8]>, |
| 31 | builderrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#builder.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<Zip64ExtendedInformationExtraFieldBuilderrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#>, |
| 32 | lh_offsetrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#lh_offset.: u64, |
| 33 | precompressedrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#precompressed.: bool, |
| 34 | } |
| 35 | |
| 36 | impl<'b, 'c, W: AsyncWriterust-analyzer cargo futures-io 0.3.25 if_std/AsyncWrite# + Unpinrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Unpin#> EntryWholeWriterrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#<'b, 'c, W> { |
| 37 | pub fn from_rawrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]from_raw().(writer: &'b mut ZipFileWriterrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#<W>, entry: ZipEntryrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#, data: &'c [u8]) -> Selfrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`] { |
| 38 | Selfrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`] { writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer., entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry., datarust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#data.: Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#::Borrowedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#Borrowed#(data), builderrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#builder.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, lh_offsetrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#lh_offset.: 0, precompressedrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#precompressed.: false } |
| 39 | } |
| 40 | |
| 41 | pub fn from_precompressedrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]from_precompressed().(writer: &'b mut ZipFileWriterrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#<W>, entry: ZipEntryrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#, data: &'c [u8]) -> Selfrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`] { |
| 42 | Selfrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`] { writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer., entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry., datarust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#data.: Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#::Borrowedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#Borrowed#(data), builderrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#builder.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, lh_offsetrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#lh_offset.: 0, precompressedrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#precompressed.: true } |
| 43 | } |
| 44 | |
| 45 | async fn compressrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]compress().(&mut self) { |
| 46 | if self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..compressionrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]compression().() rust-analyzer cargo async_zip 0.0.18 spec/compression/impl#[Compression][`PartialEq<Self>`]eq().==rust-analyzer cargo async_zip 0.0.18 spec/compression/impl#[Compression][`PartialEq<Self>`]eq(). rust-analyzer cargo async_zip 0.0.18 spec/compression/impl#[Compression][`PartialEq<Self>`]eq().Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Storedrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#Stored# { |
| 47 | return; |
| 48 | } |
| 49 | |
| 50 | #[cfg(any( |
| 51 | feature = "deflate", |
| 52 | feature = "bzip2", |
| 53 | feature = "zstd", |
| 54 | feature = "lzma", |
| 55 | feature = "xz", |
| 56 | feature = "deflate64" |
| 57 | ))] |
| 58 | { |
| 59 | let new_data = compressrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/compress().(&self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry., &self.datarust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#data.).rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().; |
| 60 | self.datarust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#data. = Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#::Ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#Owned#(new_data); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | fn enforce_zip64_sizesrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]enforce_zip64_sizes().(&mut self) -> Resultrust-analyzer cargo async_zip 0.0.18 error/Result#<()> { |
| 65 | let uncompressed_larger = self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..uncompressed_sizerust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#uncompressed_size. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().NON_ZIP64_MAX_SIZErust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_SIZE..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 66 | let compressed_larger = self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..compressed_sizerust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#compressed_size. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]gt().NON_ZIP64_MAX_SIZErust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_SIZE..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 67 | |
| 68 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().uncompressed_larger && !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().compressed_larger { |
| 69 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()); |
| 70 | } |
| 71 | |
| 72 | self.enforce_zip64rust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]enforce_zip64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 73 | |
| 74 | // TODO: accept ZipEntry with sizes already set |
| 75 | let builder = Zip64ExtendedInformationExtraFieldBuilderrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#::newrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]new().(); |
| 76 | let builder = builder.sizesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]sizes().(self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..compressed_sizerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]compressed_size().(), self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..uncompressed_sizerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]uncompressed_size().()); |
| 77 | self.builderrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#builder. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(builder); |
| 78 | |
| 79 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..uncompressed_sizerust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#uncompressed_size. = NON_ZIP64_MAX_SIZErust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_SIZE..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 80 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..compressed_sizerust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#compressed_size. = NON_ZIP64_MAX_SIZErust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_SIZE..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 81 | |
| 82 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 83 | } |
| 84 | |
| 85 | fn enforce_zip64_offsetrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]enforce_zip64_offset().(&mut self) -> Resultrust-analyzer cargo async_zip 0.0.18 error/Result#<()> { |
| 86 | if self.lh_offsetrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#lh_offset. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().<=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[u64][`PartialOrd<Self>`]le().NON_ZIP64_MAX_SIZErust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_SIZE..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() { |
| 87 | return Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()); |
| 88 | } |
| 89 | |
| 90 | self.enforce_zip64rust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]enforce_zip64().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 91 | |
| 92 | let builder = self.builderrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#builder..takerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]take().().unwrap_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or().(Zip64ExtendedInformationExtraFieldBuilderrust-analyzer cargo async_zip 0.0.18 spec/extra_field/Zip64ExtendedInformationExtraFieldBuilder#::newrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]new().()); |
| 93 | let builder = builder.relative_header_offsetrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]relative_header_offset().(self.lh_offsetrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#lh_offset.); |
| 94 | self.builderrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#builder. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(builder); |
| 95 | |
| 96 | self.lh_offsetrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#lh_offset. = NON_ZIP64_MAX_SIZErust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_SIZE..intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(); |
| 97 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 98 | } |
| 99 | |
| 100 | fn enforce_zip64rust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]enforce_zip64().(&mut self) -> Resultrust-analyzer cargo async_zip 0.0.18 error/Result#<()> { |
| 101 | if self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..force_no_zip64rust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#force_no_zip64. { |
| 102 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::Zip64Neededrust-analyzer cargo async_zip 0.0.18 error/ZipError#Zip64Needed#(Zip64ErrorCaserust-analyzer cargo async_zip 0.0.18 error/Zip64ErrorCase#::LargeFilerust-analyzer cargo async_zip 0.0.18 error/Zip64ErrorCase#LargeFile#)); |
| 103 | } |
| 104 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..is_zip64rust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#is_zip64. { |
| 105 | self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..is_zip64rust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#is_zip64. = true; |
| 106 | } |
| 107 | |
| 108 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 109 | } |
| 110 | |
| 111 | fn utf8_without_alternativerust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]utf8_without_alternative().(&mut self) -> bool { |
| 112 | let utf8_without_alternative = |
| 113 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..filenamerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]filename().().is_utf8_without_alternativerust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]is_utf8_without_alternative().() && self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..commentrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]comment().().is_utf8_without_alternativerust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]is_utf8_without_alternative().(); |
| 114 | |
| 115 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().utf8_without_alternative { |
| 116 | if matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..filenamerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]filename().().encodingrust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]encoding().(), StringEncodingrust-analyzer cargo async_zip 0.0.18 string/StringEncoding#::Utf8rust-analyzer cargo async_zip 0.0.18 string/StringEncoding#Utf8#) { |
| 117 | let u_file_name = self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..filenamerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]filename().().as_bytesrust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]as_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(); |
| 118 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().u_file_name.is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]is_empty().() { |
| 119 | let basic_crc32 = crc32fastrust-analyzer cargo crc32fast 1.4.2 crate/::hashrust-analyzer cargo crc32fast 1.4.2 hash().( |
| 120 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..filenamerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]filename().().alternativerust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]alternative().().unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..filenamerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]filename().().as_bytesrust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]as_bytes().()), |
| 121 | ); |
| 122 | let upath_field = |
| 123 | get_or_put_info_zip_unicode_path_extra_field_mutrust-analyzer cargo async_zip 0.0.18 base/write/get_or_put_info_zip_unicode_path_extra_field_mut().(self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..extra_fieldsrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#extra_fields..as_mutrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`AsMut<Self>`]as_mut().()); |
| 124 | if let InfoZipUnicodePathExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#::V1rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1# { crc32rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1#crc32., unicoderust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodePathExtraField#V1#unicode. } = upath_field { |
| 125 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().crc32 = basic_crc32; |
| 126 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().unicode = u_file_name; |
| 127 | } |
| 128 | } |
| 129 | } |
| 130 | if matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/matches!!(self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..commentrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]comment().().encodingrust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]encoding().(), StringEncodingrust-analyzer cargo async_zip 0.0.18 string/StringEncoding#::Utf8rust-analyzer cargo async_zip 0.0.18 string/StringEncoding#Utf8#) { |
| 131 | let u_comment = self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..commentrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]comment().().as_bytesrust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]as_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(); |
| 132 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().u_comment.is_emptyrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]is_empty().() { |
| 133 | let basic_crc32 = crc32fastrust-analyzer cargo crc32fast 1.4.2 crate/::hashrust-analyzer cargo crc32fast 1.4.2 hash().( |
| 134 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..commentrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]comment().().alternativerust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]alternative().().unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..commentrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]comment().().as_bytesrust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]as_bytes().()), |
| 135 | ); |
| 136 | let ucom_field = |
| 137 | get_or_put_info_zip_unicode_comment_extra_field_mutrust-analyzer cargo async_zip 0.0.18 base/write/get_or_put_info_zip_unicode_comment_extra_field_mut().(self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..extra_fieldsrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#extra_fields..as_mutrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`AsMut<Self>`]as_mut().()); |
| 138 | if let InfoZipUnicodeCommentExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#::V1rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1# { crc32rust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1#crc32., unicoderust-analyzer cargo async_zip 0.0.18 spec/header/InfoZipUnicodeCommentExtraField#V1#unicode. } = ucom_field { |
| 139 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().crc32 = basic_crc32; |
| 140 | *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/deref/impl#[`&mut T`][Deref]deref().unicode = u_comment; |
| 141 | } |
| 142 | } |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | utf8_without_alternative |
| 147 | } |
| 148 | |
| 149 | pub async fn writerust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]write().(mut self) -> Resultrust-analyzer cargo async_zip 0.0.18 error/Result#<()> { |
| 150 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.precompressedrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#precompressed. { |
| 151 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..uncompressed_sizerust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#uncompressed_size. = self.datarust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#data..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as u64; |
| 152 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..crc32rust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#crc32. = crc32fastrust-analyzer cargo crc32fast 1.4.2 crate/::hashrust-analyzer cargo crc32fast 1.4.2 hash().(&self.datarust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#data.); |
| 153 | |
| 154 | self.compressrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]compress().().rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().; |
| 155 | } |
| 156 | |
| 157 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..compressed_sizerust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#compressed_size. = self.datarust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#data..lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().() as u64; |
| 158 | self.enforce_zip64_sizesrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]enforce_zip64_sizes().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 159 | |
| 160 | self.lh_offsetrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#lh_offset. = self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..writerrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#writer..offsetrust-analyzer cargo async_zip 0.0.18 base/write/io/offset/impl#[`AsyncOffsetWriter<W>`]offset().(); |
| 161 | self.enforce_zip64_offsetrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]enforce_zip64_offset().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 162 | |
| 163 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(builder) = self.builderrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#builder. { |
| 164 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().builder.eof_onlyrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]eof_only().() { |
| 165 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..extra_fieldsrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#extra_fields..pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::Zip64ExtendedInformationrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#Zip64ExtendedInformation#(builder.buildrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]build().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)); |
| 166 | self.builderrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#builder. = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#; |
| 167 | } else { |
| 168 | self.builderrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#builder. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(builder); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | let utf8_without_alternative = self.utf8_without_alternativerust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/impl#[`EntryWholeWriter<'b, 'c, W>`]utf8_without_alternative().(); |
| 173 | let filename_basic = self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..filenamerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]filename().().alternativerust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]alternative().().unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..filenamerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]filename().().as_bytesrust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]as_bytes().()); |
| 174 | let comment_basic = self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..commentrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]comment().().alternativerust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]alternative().().unwrap_or_elserust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]unwrap_or_else().(|| self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..commentrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]comment().().as_bytesrust-analyzer cargo async_zip 0.0.18 string/impl#[ZipString]as_bytes().()); |
| 175 | |
| 176 | let lf_header = LocalFileHeaderrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader# { |
| 177 | compressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#compressed_size.: self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..compressed_sizerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]compressed_size().() as u32, |
| 178 | uncompressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#uncompressed_size.: self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..uncompressed_sizerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]uncompressed_size().() as u32, |
| 179 | compressionrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#compression.: self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..compressionrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]compression().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 180 | crcrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#crc.: self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..crc32rust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]crc32().(), |
| 181 | extra_field_lengthrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#extra_field_length.: self |
| 182 | .entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry. |
| 183 | .extra_fieldsrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]extra_fields().() |
| 184 | .count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[`&[ExtraField]`][ExtraFieldAsBytes]count_bytes().() |
| 185 | .try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().() |
| 186 | .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::ExtraFieldTooLargerust-analyzer cargo async_zip 0.0.18 error/ZipError#ExtraFieldTooLarge#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 187 | file_name_lengthrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#file_name_length.: filename_basic.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().().try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::FileNameTooLargerust-analyzer cargo async_zip 0.0.18 error/ZipError#FileNameTooLarge#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 188 | mod_timerust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#mod_time.: self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..last_modification_daterust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]last_modification_date().().timerust-analyzer cargo async_zip 0.0.18 date/ZipDateTime#time., |
| 189 | mod_daterust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#mod_date.: self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..last_modification_daterust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]last_modification_date().().daterust-analyzer cargo async_zip 0.0.18 date/ZipDateTime#date., |
| 190 | versionrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#version.: craterust-analyzer cargo async_zip 0.0.18 crate/::specrust-analyzer cargo async_zip 0.0.18 spec/::versionrust-analyzer cargo async_zip 0.0.18 spec/version/::as_needed_to_extractrust-analyzer cargo async_zip 0.0.18 spec/version/as_needed_to_extract().(&self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry.), |
| 191 | flagsrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#flags.: GeneralPurposeFlagrust-analyzer cargo async_zip 0.0.18 spec/header/GeneralPurposeFlag# { |
| 192 | data_descriptorrust-analyzer cargo async_zip 0.0.18 spec/header/GeneralPurposeFlag#data_descriptor.: false, |
| 193 | encryptedrust-analyzer cargo async_zip 0.0.18 spec/header/GeneralPurposeFlag#encrypted.: false, |
| 194 | filename_unicoderust-analyzer cargo async_zip 0.0.18 spec/header/GeneralPurposeFlag#filename_unicode.: utf8_without_alternative, |
| 195 | }, |
| 196 | }; |
| 197 | |
| 198 | let mut header = CentralDirectoryRecordrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord# { |
| 199 | v_made_byrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#v_made_by.: craterust-analyzer cargo async_zip 0.0.18 crate/::specrust-analyzer cargo async_zip 0.0.18 spec/::versionrust-analyzer cargo async_zip 0.0.18 spec/version/::as_made_byrust-analyzer cargo async_zip 0.0.18 spec/version/as_made_by().(), |
| 200 | v_neededrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#v_needed.: lf_header.versionrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#version., |
| 201 | compressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#compressed_size.: lf_header.compressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#compressed_size., |
| 202 | uncompressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#uncompressed_size.: lf_header.uncompressed_sizerust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#uncompressed_size., |
| 203 | compressionrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#compression.: lf_header.compressionrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#compression., |
| 204 | crcrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#crc.: lf_header.crcrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#crc., |
| 205 | extra_field_lengthrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#extra_field_length.: lf_header.extra_field_lengthrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#extra_field_length., |
| 206 | file_name_lengthrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#file_name_length.: lf_header.file_name_lengthrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#file_name_length., |
| 207 | file_comment_lengthrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#file_comment_length.: comment_basic.lenrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]len().().try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::CommentTooLargerust-analyzer cargo async_zip 0.0.18 error/ZipError#CommentTooLarge#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 208 | mod_timerust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#mod_time.: lf_header.mod_timerust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#mod_time., |
| 209 | mod_daterust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#mod_date.: lf_header.mod_daterust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#mod_date., |
| 210 | flagsrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#flags.: lf_header.flagsrust-analyzer cargo async_zip 0.0.18 spec/header/LocalFileHeader#flags., |
| 211 | disk_startrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#disk_start.: 0, |
| 212 | inter_attrrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#inter_attr.: self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..internal_file_attributerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]internal_file_attribute().(), |
| 213 | exter_attrrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#exter_attr.: self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..external_file_attributerust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]external_file_attribute().(), |
| 214 | lh_offsetrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#lh_offset.: self.lh_offsetrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#lh_offset. as u32, |
| 215 | }; |
| 216 | |
| 217 | self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..writerrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#writer..write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(&craterust-analyzer cargo async_zip 0.0.18 crate/::specrust-analyzer cargo async_zip 0.0.18 spec/::constsrust-analyzer cargo async_zip 0.0.18 spec/consts/::LFH_SIGNATURErust-analyzer cargo async_zip 0.0.18 spec/consts/LFH_SIGNATURE..to_le_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core num/impl#[u32]to_le_bytes().()).rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 218 | self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..writerrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#writer..write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(&lf_header.as_slicerust-analyzer cargo async_zip 0.0.18 spec/parse/impl#[LocalFileHeader]as_slice().()).rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 219 | self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..writerrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#writer..write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(filename_basic).rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 220 | self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..writerrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#writer..write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(&self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..extra_fieldsrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]extra_fields().().as_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[`&[ExtraField]`][ExtraFieldAsBytes]as_bytes().()).rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 221 | self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..writerrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#writer..write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(&self.datarust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#data.).rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 222 | |
| 223 | if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(builder1) = self.builderrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#builder. { |
| 224 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..extra_fieldsrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#extra_fields..pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(ExtraFieldrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#::Zip64ExtendedInformationrust-analyzer cargo async_zip 0.0.18 spec/header/ExtraField#Zip64ExtendedInformation#(builder1.buildrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[Zip64ExtendedInformationExtraFieldBuilder]build().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)); |
| 225 | header.extra_field_lengthrust-analyzer cargo async_zip 0.0.18 spec/header/CentralDirectoryRecord#extra_field_length. = |
| 226 | self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry..extra_fieldsrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]extra_fields().().count_bytesrust-analyzer cargo async_zip 0.0.18 spec/extra_field/impl#[`&[ExtraField]`][ExtraFieldAsBytes]count_bytes().().try_intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`TryInto<U>`]try_into().().map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|_| ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::ExtraFieldTooLargerust-analyzer cargo async_zip 0.0.18 error/ZipError#ExtraFieldTooLarge#)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 227 | } |
| 228 | |
| 229 | self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..cd_entriesrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#cd_entries..pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(CentralDirectoryEntryrust-analyzer cargo async_zip 0.0.18 base/write/CentralDirectoryEntry# { headerrust-analyzer cargo async_zip 0.0.18 base/write/CentralDirectoryEntry#header., entryrust-analyzer cargo async_zip 0.0.18 base/write/CentralDirectoryEntry#entry.: self.entryrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#entry. }); |
| 230 | // Ensure that we can fit this many files in this archive if forcing no zip64 |
| 231 | if self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..cd_entriesrust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#cd_entries..lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[usize][`PartialOrd<Self>`]gt().NON_ZIP64_MAX_NUM_FILESrust-analyzer cargo async_zip 0.0.18 spec/consts/NON_ZIP64_MAX_NUM_FILES. as usize { |
| 232 | if self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..force_no_zip64rust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#force_no_zip64. { |
| 233 | return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(ZipErrorrust-analyzer cargo async_zip 0.0.18 error/ZipError#::Zip64Neededrust-analyzer cargo async_zip 0.0.18 error/ZipError#Zip64Needed#(Zip64ErrorCaserust-analyzer cargo async_zip 0.0.18 error/Zip64ErrorCase#::TooManyFilesrust-analyzer cargo async_zip 0.0.18 error/Zip64ErrorCase#TooManyFiles#)); |
| 234 | } |
| 235 | if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..is_zip64rust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#is_zip64. { |
| 236 | self.writerrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/EntryWholeWriter#writer..is_zip64rust-analyzer cargo async_zip 0.0.18 base/write/ZipFileWriter#is_zip64. = true; |
| 237 | } |
| 238 | } |
| 239 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(()) |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | #[cfg(any( |
| 244 | feature = "deflate", |
| 245 | feature = "bzip2", |
| 246 | feature = "zstd", |
| 247 | feature = "lzma", |
| 248 | feature = "xz", |
| 249 | feature = "deflate64" |
| 250 | ))] |
| 251 | /// Compresses the data of a ZIP entry using the specified compression method and level. |
| 252 | pub async fn compressrust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/compress().(entry: &ZipEntryrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#, data: &[u8]) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8> { |
| 253 | // TODO: Reduce reallocations of Vec by making a lower-bound estimate of the length reduction and |
| 254 | // pre-initialising the Vec to that length. Then truncate() to the actual number of bytes written. |
| 255 | let level = entry.compression_levelrust-analyzer cargo async_zip 0.0.18 entry/ZipEntry#compression_level.; |
| 256 | |
| 257 | match entry.compressionrust-analyzer cargo async_zip 0.0.18 entry/impl#[ZipEntry]compression().() { |
| 258 | #[cfg(feature = "deflate")] |
| 259 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Deflaterust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#Deflate# => { |
| 260 | let mut writer = writerust-analyzer cargo async-compression 0.4.27 futures/write/::DeflateEncoderrust-analyzer cargo async-compression 0.4.27 futures/write/DeflateEncoder#::with_qualityrust-analyzer cargo async-compression 0.4.27 futures/write/impl#[`DeflateEncoder<W>`]with_quality().(Cursorrust-analyzer cargo futures-lite 2.1.0 io/Cursor#::newrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]new().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().()), level); |
| 261 | writer.write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(data).rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll()..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 262 | writer.closerust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#close().().rust-analyzer cargo futures-lite 2.1.0 io/impl#[`CloseFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`CloseFuture<'_, W>`][Future]poll()..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 263 | writer.into_innerrust-analyzer cargo async-compression 0.4.27 futures/write/impl#[`DeflateEncoder<W>`]into_inner().().into_innerrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]into_inner().() |
| 264 | } |
| 265 | #[cfg(feature = "deflate64")] |
| 266 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Deflate64 => panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("compressing deflate64 is not supported"), |
| 267 | #[cfg(feature = "bzip2")] |
| 268 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Bzrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#Bz# => { |
| 269 | let mut writer = writerust-analyzer cargo async-compression 0.4.27 futures/write/::BzEncoderrust-analyzer cargo async-compression 0.4.27 futures/write/BzEncoder#::with_qualityrust-analyzer cargo async-compression 0.4.27 futures/write/impl#[`BzEncoder<W>`]with_quality().(Cursorrust-analyzer cargo futures-lite 2.1.0 io/Cursor#::newrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]new().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().()), level); |
| 270 | writer.write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(data).rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll()..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 271 | writer.closerust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#close().().rust-analyzer cargo futures-lite 2.1.0 io/impl#[`CloseFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`CloseFuture<'_, W>`][Future]poll()..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 272 | writer.into_innerrust-analyzer cargo async-compression 0.4.27 futures/write/impl#[`BzEncoder<W>`]into_inner().().into_innerrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]into_inner().() |
| 273 | } |
| 274 | #[cfg(feature = "lzma")] |
| 275 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Lzmarust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#Lzma# => { |
| 276 | let mut writer = writerust-analyzer cargo async-compression 0.4.27 futures/write/::LzmaEncoderrust-analyzer cargo async-compression 0.4.27 futures/write/LzmaEncoder#::with_qualityrust-analyzer cargo async-compression 0.4.27 futures/write/impl#[`LzmaEncoder<W>`]with_quality().(Cursorrust-analyzer cargo futures-lite 2.1.0 io/Cursor#::newrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]new().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().()), level); |
| 277 | writer.write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(data).rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll()..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 278 | writer.closerust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#close().().rust-analyzer cargo futures-lite 2.1.0 io/impl#[`CloseFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`CloseFuture<'_, W>`][Future]poll()..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 279 | writer.into_innerrust-analyzer cargo async-compression 0.4.27 futures/write/impl#[`LzmaEncoder<W>`]into_inner().().into_innerrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]into_inner().() |
| 280 | } |
| 281 | #[cfg(feature = "xz")] |
| 282 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Xzrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#Xz# => { |
| 283 | let mut writer = writerust-analyzer cargo async-compression 0.4.27 futures/write/::XzEncoderrust-analyzer cargo async-compression 0.4.27 futures/write/XzEncoder#::with_qualityrust-analyzer cargo async-compression 0.4.27 futures/write/impl#[`XzEncoder<W>`]with_quality().(Cursorrust-analyzer cargo futures-lite 2.1.0 io/Cursor#::newrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]new().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().()), level); |
| 284 | writer.write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(data).rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll()..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 285 | writer.closerust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#close().().rust-analyzer cargo futures-lite 2.1.0 io/impl#[`CloseFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`CloseFuture<'_, W>`][Future]poll()..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 286 | writer.into_innerrust-analyzer cargo async-compression 0.4.27 futures/write/impl#[`XzEncoder<W>`]into_inner().().into_innerrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]into_inner().() |
| 287 | } |
| 288 | #[cfg(feature = "zstd")] |
| 289 | Compressionrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#::Zstdrust-analyzer cargo async_zip 0.0.18 spec/compression/Compression#Zstd# => { |
| 290 | let mut writer = writerust-analyzer cargo async-compression 0.4.27 futures/write/::ZstdEncoderrust-analyzer cargo async-compression 0.4.27 futures/write/ZstdEncoder#::with_qualityrust-analyzer cargo async-compression 0.4.27 futures/write/impl#[`ZstdEncoder<W>`]with_quality().(Cursorrust-analyzer cargo futures-lite 2.1.0 io/Cursor#::newrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]new().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().()), level); |
| 291 | writer.write_allrust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#write_all().(data).rust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`WriteAllFuture<'_, W>`][Future]poll()..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 292 | writer.closerust-analyzer cargo futures-lite 2.1.0 io/AsyncWriteExt#close().().rust-analyzer cargo futures-lite 2.1.0 io/impl#[`CloseFuture<'_, W>`][Future]poll().awaitrust-analyzer cargo futures-lite 2.1.0 io/impl#[`CloseFuture<'_, W>`][Future]poll()..unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 293 | writer.into_innerrust-analyzer cargo async-compression 0.4.27 futures/write/impl#[`ZstdEncoder<W>`]into_inner().().into_innerrust-analyzer cargo futures-lite 2.1.0 io/impl#[`Cursor<T>`]into_inner().() |
| 294 | } |
| 295 | _ => unreachablerust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/unreachable!!(), |
| 296 | } |
| 297 | } |
| 298 | |
| 299 | /// Performs a CRC32 checksum on the provided data. |
| 300 | pub fn crc32rust-analyzer cargo async_zip 0.0.18 base/write/entry_whole/crc32().(data: &[u8]) -> u32 { |
| 301 | crc32fastrust-analyzer cargo crc32fast 1.4.2 crate/::hashrust-analyzer cargo crc32fast 1.4.2 hash().(data) |
| 302 | } |