Error: use of undeclared type or module `futures_util`
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.3k
- Forks
- 1.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 14
Description
Hi, I straight up copied the echo example and am trying to run it.
I tried putting this in my Cargo.toml [dependencies]
[dependencies]
hyper = "0.13"
tokio = { version = "0.2", features = ["full"] }
futures-core = { version = "0.3", default-features = false }
futures-channel = "0.3"
futures-util = { version = "0.3", default-features = false }
[dev-dependencies]
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
But when in my IDE and when I try to run it I see these two errors:
error[E0433]: failed to resolve: use of undeclared type or module `futures_util`
--> src/main.rs:3:5
|
3 | use futures_util::stream::try_stream::TryStreamExt;
| ^^^^^^^^^^^^ use of undeclared type or module `futures_util`
error[E0599]: no method named `map_ok` found for struct `hyper::body::body::Body` in the current scope
--> src/main.rs:21:48
|
21 | let chunk_stream = req.into_body().map_ok(|chunk| {
| ^^^^^^ method not found in `hyper::body::body::Body`
|
= help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
|
3 | use futures_util::stream::try_stream::TryStreamExt;
|
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with examples/echo.rs and the user's src/main.rs, then compare the Cargo.toml dependency declarations with the example's imports. Reproduce the reported compiler errors and determine whether the example or its dependency instructions need updating; done means the example's documented setup compiles without these errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100