Skip to content

Update async_zip to 0.0.17#281

Closed
lafrenierejm wants to merge 2 commits intophiresky:masterfrom
lafrenierejm:async-zip
Closed

Update async_zip to 0.0.17#281
lafrenierejm wants to merge 2 commits intophiresky:masterfrom
lafrenierejm:async-zip

Conversation

@lafrenierejm
Copy link
Copy Markdown
Contributor

Updating this dependency is a prerequisite for #258.

@lafrenierejm
Copy link
Copy Markdown
Contributor Author

@phiresky Any suggestions for how best to resolve the type errors?

$ cargo build
error[E0277]: the trait bound `ZipEntryReader<'_, Compat<tokio::io::BufReader<tokio::fs::File>>, WithoutEntry>: tokio::io::AsyncRead` is not satisfied
  --> src/adapters/zip.rs:92:31
   |
92 | ...                   >(reader)
   |                         ^^^^^^ the trait `tokio::io::AsyncRead` is not implemented for `ZipEntryReader<'_, Compat<tokio::io::BufReader<tokio::fs::File>>, WithoutEntry>`
   |
   = help: the following other types implement trait `tokio::io::AsyncRead`:
             &[u8]
             &mut T
             Archive<R>
             Box<T>
             BufStream<RW>
             Compat<T>
             DuplexStream
             Either<L, R>
           and 67 others
   = note: required for the cast from `std::pin::Pin<&mut ZipEntryReader<'_, Compat<tokio::io::BufReader<tokio::fs::File>>, WithoutEntry>>` to `std::pin::Pin<&mut dyn tokio::io::AsyncRead + Send>`

error[E0277]: the trait bound `dyn tokio::io::AsyncRead + Send: futures_io::if_std::AsyncBufRead` is not satisfied
   --> src/adapters/zip.rs:110:46
    |
110 |             let mut zip = ZipFileReader::new(inp);
    |                           ------------------ ^^^ the trait `futures_io::if_std::AsyncBufRead` is not implemented for `dyn tokio::io::AsyncRead + Send`
    |                           |
    |                           required by a bound introduced by this call
    |
    = help: the following other types implement trait `futures_io::if_std::AsyncBufRead`:
              &[u8]
              &mut T
              Box<T>
              Compat<T>
              async_compression::futures::write::BrotliDecoder<W>
              async_compression::futures::write::BrotliEncoder<W>
              async_compression::futures::write::BzDecoder<W>
              async_compression::futures::write::BzEncoder<W>
            and 21 others
    = note: required for `std::pin::Pin<Box<dyn tokio::io::AsyncRead + Send>>` to implement `futures_io::if_std::AsyncBufRead`
note: required by a bound in `async_zip::base::read::stream::ZipFileReader::<async_zip::base::read::stream::Ready<R>>::new`
   --> /home/lafrenierejm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/async_zip-0.0.17/src/base/read/stream.rs:81:8
    |
81  |     R: AsyncBufRead + Unpin + 'a,
    |        ^^^^^^^^^^^^ required by this bound in `ZipFileReader::<Ready<R>>::new`
...
84  |     pub fn new(reader: R) -> Self {
    |            --- required by a bound in this associated function

error[E0599]: the method `next_with_entry` exists for struct `ZipFileReader<Ready<Pin<Box<dyn AsyncRead + Send>>>>`, but its trait bounds were not satisfied
    --> src/adapters/zip.rs:114:53
     |
114  |                     while let Some(mut entry) = zip.next_with_entry().await? {
     |                                                     ^^^^^^^^^^^^^^^ method cannot be called due to unsatisfied trait bounds
     |
    ::: /nix/store/hmpzw9x9c2bl5p7x6lss7yhy7qjig7qd-rust-default-1.85.0/lib/rustlib/src/rust/library/core/src/pin.rs:1089:1
     |
1089 | pub struct Pin<Ptr> {
     | ------------------- doesn't satisfy `_: AsyncBufRead`
     |
    ::: /home/lafrenierejm/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.43.0/src/io/async_read.rs:44:1
     |
44   | pub trait AsyncRead {
     | ------------------- doesn't satisfy `_: AsyncBufRead`
     |
     = note: the following trait bounds were not satisfied:
             `dyn tokio::io::AsyncRead + Send: futures_io::if_std::AsyncBufRead`
             which is required by `std::pin::Pin<Box<dyn tokio::io::AsyncRead + Send>>: futures_io::if_std::AsyncBufRead`

Some errors have detailed explanations: E0277, E0599.
For more information about an error, try `rustc --explain E0277`.

@phiresky
Copy link
Copy Markdown
Owner

phiresky commented Mar 2, 2025

haven't looked but did you read the change log of async zip? might have migration tips or the could be asked directly

@werdahias
Copy link
Copy Markdown

The way the readers were set up changed after 0.11. https://github.com/Majored/rs-async-zip/blob/main/examples/file_extraction.rs is a good resource; I tried my hand at it but my rust is too bad

@lafrenierejm
Copy link
Copy Markdown
Contributor Author

lafrenierejm commented Dec 7, 2025

Superseded by #328.

@lafrenierejm lafrenierejm deleted the async-zip branch December 20, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants