【问题标题】:Are the async/await capabilities in std a replacement for tokio?std 中的 async/await 功能是否可以替代 tokio?
【发布时间】:2020-03-19 12:07:07
【问题描述】:

在标准库中添加了 async/await 后,现在这是替代和/或更推荐使用像 tokio 这样的 crate 的方法吗?

【问题讨论】:

  • 它不是替代品,它更像是Futures 的全局接口。因此,其他库应用了 Rust 标准中的 Futures。

标签: rust rust-tokio


【解决方案1】:

它们是互补的。

标准库仅包含最基本的类型和特征,但不包含运行时。

运行时旨在由其他 crate 提供,例如 tokioasync-std

【讨论】:

    猜你喜欢
    • 2019-06-13
    • 2019-04-30
    • 2016-11-16
    • 1970-01-01
    • 2020-03-22
    • 1970-01-01
    • 2020-02-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多