There is a feature flag on async-std: tokio1
async-std = { version = "1", features = ["tokio1", "attributes"] }
Then I can use async_std::main on tokio stuff:
#[async_std::main]
async fn main() -> std::io::Result<()> {
// some tokio dependent async libraries run here
Ok(())
}
Basically it makes tokio dependent crates run with async-std crate.
I have two questions:
- How does it work? (what is happening in the background?)
- Does it affect the performance to mimic tokio libraries or it is just zero cost abstraction?