我有以下问题:
我试图从
由于在目前的情况下
我找到了一些相关的问题,例如这个,但是当我尝试实现时,我收到了以下错误:
async
函数中调用sync
闭包,但是sync闭包
需要稍后调用另一个async
函数。由于在目前的情况下
async闭包
不稳定,所以我不能创建它们:
error[E0658]: async closures are unstable
所以我必须通过某种方式来解决这个问题。我找到了一些相关的问题,例如这个,但是当我尝试实现时,我收到了以下错误:
Cannot start a runtime from within a runtime.
This happens because a function (like `block_on`)
attempted to block the current thread while the
thread is being used to drive asynchronous tasks.'
这里是一个playground链接,希望可以展示我遇到的问题。
如标题所述,我正在使用tokio。
|| async { ... }
而不是async || { ... }
。 - Cerberus