4 ms·
> Working with async Rust is very simple if you are not writing futures yourself. > Tokio and async-std provide api's that mirror std except for the fact that
by masklinn 6y ago
> Working with async Rust is very simple if you are not writing futures yourself.
> Tokio and async-std provide api's that mirror std except for the fact that you have to add `.await` to the end of the operation and add the `async` keyword to your function.
There are absolute pain in the ass problems with `async` currently, in large part due to async closures not being a thing, which means it's very hard to create anything other than an `FnOnce` unless you desugar the future entirely.
- ibraheemdev 6y agoAsync `Fn*` traits are possible on nightly with the `unboxed_closures` and `async_closure` features.
- masklinn 6y agoYes, by "not being a thing" I meant "not being stable", I thought I'd edited before posting but apparently I only thought of doing so, sorry 'bout that.
- estebank 6y agoI don't consider things enabled by nightly features to be "possible" today, only "potentially possible at some time in the future". The days of using nightly because of a single needed feature in a popular crate are (in my eyes) gone.