use stdpython :: * ; use tokio ; pub async fn python_main () -> Result < & 'static str , PyException > { print (& ("Async main function")) ; asyncio :: sleep (0.1) . await ; return Ok ("async_result") ; } pub fn sync_helper () -> Result < () , PyException > { print (& ("Sync helper function")) ; Ok (()) } # [tokio :: main] async fn main () { let __rython_result : Result < () , PyException > = async { let result ; ; result = asyncio :: run (python_main () ?) ; ; sync_helper () ? ; print (& (format ! ("Async result: {}" , py_display (& (result))))) ; Ok (()) } . await ; if let Err (e) = __rython_result { eprintln ! ("{}" , e) ; std :: process :: exit (1) ; } }