You can’t “unbox” a BoxFuture, but of course you can use await on it. Your code is containing too many uses of the keyword async, you probably want to write fn foo() instead of async fn foo().
async fn foo() -> BoxFuture<'static, u32> means that foo() produces a Future (due to async fn) whose Output in turn is a BoxFuture and only the Output of that is u32. You could also change the call to foo().await.await, but that seems like hacking around the underlying problem.
If you have further questions, maybe a less simplified version of your real world problem would help.
Hm, ok .await.wait works, thanks. I have not realised, there is an additional future somewhere in there.
Well, the function needs to return BoxFuture because it is recursive. I struggled with using that return type.
Do you have any suggestion how to handle recursive async functions better?
Yes, that makes sense. I was in "add a lot of async keywords" mode in order to make my code work with external async functions.
After making the return type a BoxFuture i did not think of removing the async for that one function.