Open Json1949 opened 3 years ago
You need to run this under Tokio 1.0 like error says. According to Cargo.toml and incomplete main.rs you might be running it under async-std runtime instead.
Yes, this looks to be the case.
I do have experimental support for async-std
in a branch, but this isn't ready yet. The current default is Tokio 1.x, but there is also support for Tokio 0.2 behind a feature flag if necessary.
same problem,i also use it in actix_web,and get this error
Hello, unfortunately I'm not familiar with Actix Web, but @nazar-pc 's comment above is correct in the sense this error means that a Tokio runtime isn't running which is required for this library to work.
So I'm guessing something has recently changed with Actix Web, perhaps allowing it to run under different async runtimes?
But if Actix is still Tokio based then something else is going on.
Actix-web 3.x uses Tokio 0.2, while 4.x (which is beta currently) switched to Tokio 1.0. Just pick versions correctly, there is nothing to do about it in this crate.
You need to run this under Tokio 1.0 like error says. According to Cargo.toml and incomplete main.rs you might be running it under async-std runtime instead.
ok
main.rs
Cargo.toml