3 ms·
> * Calling an async function constructs its stack frame without running any of its body. This is actually possible to do by using async blocks instead of asyn
by roblabla 7y ago
> * Calling an async function constructs its stack frame without running any of its body.
This is actually possible to do by using async blocks instead of async functions. E.G. you can write this:
fn test() -> impl Future<Output = ()> {
// Run some things directly here
println!("I am running in the current frame");
async {
// Run some things in the await
println!("I am running in the .await");
}
}