// async-compat = "0.2.1"// async-std = {version = "1.10.0"}// tokio = { version = "1", features = ["full"] }useasync_compat::Compat;asyncfnsay_hello(){println!("Hello, world!");}fnmain(){async_std::task::block_on(Compat::new(async{tokio::spawn(async{say_hello().await;// some async functionprintln!("this is also hello")});}));}
Option 2 using async-std's tokio1 runtime
// async-std = {version = "1.10.0", features = ["attributes", "tokio1"]}// tokio = { version = "1", features = ["full"] }asyncfnsay_hello(){println!("Hello, world!");}#[async_std::main]asyncfnmain(){lett=tokio::spawn(async{say_hello().await;// some async functionprintln!("this is also hello")});t.await.unwrap()}
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)