by bsder · 5y ago · 0 comments
If anything, the amount that async/await spirals outward to other areas in Rust demonstrates that it doesn't seem to be a well contained feature.
In addition, async/await executors in Rust quite often fail on corner cases. If I want to only wait on a socket, stuff works great because that's what everybody wants.
If, however, I want to do something like wait on sockets and wait on a character device file descriptor ... that tends to break in fairly mysterious ways.
https://play.rust-lang.org/?version=stable&mode=debug&editio...
I think this restriction is because they are trying to figure out how to handle dynamic vs static generics. Presumably they will add support for this in the future.
The compiler also recommends https://docs.rs/async-trait which has a pretty clean solution.