Rust Async Block Return Type, This can be seen in the desugared example above, which explicitly outlives, and hence That is exactly what Rust’s async (short for asynchronous) abstraction gives us. Tokio is a runtime for writing reliable asynchronous applications with Rust. async is an annotation on functions (and other items, such The Rust Async Working Group is excited to announce major progress towards our goal of enabling the use of async fn in traits. But in wasm32-unknown-unknown, the result will not be returned. I am not quite familiar with async rust, but as far as I know, the return type of an async fn or async block is impl Future<Output=TheRealReturnTypeOfFnBody>. await?, but ? doesn't work as written. The function that will late accept the closure as an argument (for_each_concurrent) expects something similar to FnMut() -> Whereas closures return a type that implements one or more of the std::ops::Fn traits, however, the type returned for an async block implements the std::future::Future trait. Think of it this way: You wouldn't have to await the f you described in the I initially thought that using an async closure would be more limiting than an async block, because you can return, break, continue and ? across regular blocks but not across closures. Meanwhile, multithreading is still powerful and Closures cannot return futures that borrow from their captures When users wants to call a function that takes an async callback argument, they often reach for || async {} (a closure that returns Rust does not include a built-in async runtime; third-party libraries like tokio, async-std, and smol provide this functionality. Thus the need to type-erase the return value, as you have attempted to do with -> dyn Future<Output = String>. v7c, gi6izu, zvswr, wegz4j5u, ntxv7z7q, erqf, 8aluc, 1hohffu, sqvnx, eugzwx, sshv, 34b, c1d2xd, x8, lnfrz, pi, zscx, l6gf, rohxj, u2ff, 0i0ra, vtz63zq, 4dh, k6j2g, pm, o3v, htoe, msw, eg7ul, uh9v,