1

I'm experimenting with Rust using the shiplift library and trying to run the basic example provided in the repo.

use shiplift::Docker;

#[tokio::main]
async fn main() {
    let docker = Docker::new();

    match docker.info().await {
        Ok(info) => println!("info {:?}", info),
        Err(e) => eprintln!("Error: {}", e),
    }
}

When I try to compile, I get an error:

   Compiling foo v0.1.0 (/Users/cbourne/development/rust/foo)
error[E0277]: the trait bound `impl futures::future::Future: std::future::Future` is not satisfied
 --> src/main.rs:7:11
  |
7 |     match docker.info().await {
  |           ^^^^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `impl futures::future::Future`
  |
  = note: required by `std::future::Future::poll`

My Cargo.toml file looks like this:

[package]
name = "foo"
version = "0.1.0"
authors = ["carlskii"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
shiplift = "0.6"
tokio = { version = "0.2.22", features = ["macros", "tcp", "dns", "io-util"] }
log = "0.4.0"
env_logger = "0.7.1"
futures = "0.3.1"
Shepmaster
  • 388,571
  • 95
  • 1,107
  • 1,366
user1513388
  • 7,165
  • 14
  • 69
  • 111
  • [Shiplift 0.6 uses futures 0.1, not 0.3](https://github.com/softprops/shiplift/blob/v0.6.0/Cargo.toml#L28). Looks like upgrading is [in progress](https://github.com/softprops/shiplift/commit/6cd1d7f93bd6f150341582a1b54087cefffdbf87). Perhaps you can [use it from git](https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#specifying-dependencies-from-git-repositories) – Shepmaster Jul 27 '20 at 17:38

0 Answers0