0

I'm trying to use DefaultAsyncInterface of tunio which depends on tokio feature (here)

I have added tunio with async-tokio feature in Cargo.toml:

[dependencies]
env_logger = "0.10.0"
etherparse = "0.13.0"
futures = "0.3.25"
netconfig = "0.4.0"
tokio = { version = "1.24.1", features = ["full"] }
tunio = { version = "0.3.0", features = ["async-tokio"] }

and imported it:

use tunio::{DefaultDriver,DefaultAsyncInterface};

but when I try to build I get:

error[E0432]: unresolved import `tunio::DefaultAsyncInterface`
 --> src/main.rs:7:27
  |
7 | use tunio::{DefaultDriver,DefaultAsyncInterface};
  |                           ^^^^^^^^^^^^^^^^^^^^^
  |                           |
  |                           no `DefaultAsyncInterface` in the root
  |                           help: a similar name exists in the module: `DefaultInterface`

It seems the async-tokio feature is not used
What is the problem?

AQA
  • 21
  • 2
  • Maybe I'm missing something obvious, but `tokio` and `async-tokio` are different feature names, no? The code you linked uses `tokio`. Where does `async-tokio` come from? – Brian61354270 Jan 17 '23 at 01:05
  • 1
    @Brian: yes that was the problem, it seems this crate has inconsistency between documentation and repository. documentation said I need add [`async-tokio`](https://docs.rs/crate/tunio/0.3.0/features) and with cargo there were no `tokio` feature, now I tried to install from git and now there is a `tokio` feature and everything works, thank you – AQA Jan 17 '23 at 01:54
  • Glad to hear that resolved it! It always hurts when it's something so trivial – Brian61354270 Jan 17 '23 at 02:28

0 Answers0