Created
June 6, 2024 21:57
-
-
Save ejangi/72fb653ddac526f8db40de8759d922a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use tokio::runtime::Runtime; | |
async fn async_task() -> i32 { | |
// Your asynchronous code here | |
42 | |
} | |
fn main() { | |
let rt = Runtime::new().unwrap(); | |
let result = rt.block_on(async_task()); | |
println!("Result: {}", result); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment