Closed
Conversation
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`. |
Owner
|
haven't looked but did you read the change log of async zip? might have migration tips or the could be asked directly |
|
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 |
3cb82d4 to
8f55b55
Compare
Contributor
Author
|
Superseded by #328. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updating this dependency is a prerequisite for #258.