I just want to collect the result of the try_join! -- which as I understand should be either a single Error or tuple of Results. I have tried a lot of combinations, but I can't seem to get there. It seems like the async block is not actually executed?
You are not awaiting the async {} block. The literal type of any async expression is a Future<Output = T> wrapping the type of the underlying expression.
Ok(_) has only a single field. It may be a tuple, but there still aren't 2 fields in a Result<(_, _), _>::Ok.
Thanks, indeed that does compile... you made main() async... is it possible to do it from a non async function? Basically I want the program to wait until it gets the values.
The context that includes try_joinmust be async because the macro expands to an expression that contains .await. There's no way around that.
You can technically remove the async fn main() {}, and #[tokio::main], but do note that doing so only makes you replicate the behavior of the exact same thing by hand. main is not actually async in either case – it's just that the tokio authors probably thought it was cute to indicate that the #[tokio::main] macro introduces an async context, and they wanted to be explicit about it. There's no good reason for doing all that work manually, but it can be done.