|
|
|
|
|
by gdcbe
1119 days ago
|
|
Async programming in Rust can still be a bit awkward. They're working hard on it though. https://blog.rust-lang.org/inside-rust/2023/05/03/stabilizin... We'll have Async traits in stable Rust after the summer (normally) and in 2024 they'll start working on supporting async closures :) So if all is well, you're experience should start to become more pleasant next year. For now your closures will either have to return a future (without use of `async` keyword) or you better avoid it for now. Then again, hadn't really had the need for async closures, but I did had a big need for Async traits, as implementing Traits with manual futures was so far a big pain in the ass, and sometimes still not optimal. So I for one, welcome async traits with open arms. |
|