async-std-zh
async-std-zh copied to clipboard
中文翻译:<async-rs/async-std> Rust 标准库异步版 :heart: 2019-11-19 ✅
async-rs/async-std

「 Async version of the Rust standard library 」
中文 | english
校对 ✅
翻译的原文 | 与日期 | 最新更新 | 更多 |
---|---|---|---|
commit | ⏰ 2019-11-19 | 中文翻译 |
- [x] SUMMARY
- [x] 介绍
- [x] 欢迎来到
async-std
! - [x]
std::future
和futures-rs
- [x] 稳定性保证
- [x] 欢迎来到
- [x] 使用 async-std 的异步概念
- [x] Futures
- [x] Tasks
- [ ] TODO:异步读/写
- [ ] TODO:Streams 和 Channels
- [x] 教程:实现聊天
- [x] 规格和入门
- [x] 编写一个 Accept 循环
- [x] 接收讯息
- [x] 发送讯息
- [x] 连接 Readers 和 Writers
- [x] 全部一起
- [x] 干净关闭
- [x] 处理断开连接
- [x] 实现一个 Client
- [ ] TODO:异步模式
- [ ] TODO:收集的小模式
- [x] 安全实践
- [x] 安全披露和政策
- [x] 术语
贡献
欢迎 👏 勘误/校对/更新贡献 😊 具体贡献请看
生活
If help, buy me coffee —— 营养跟不上了,给我来瓶营养快线吧! 💰
async-std
Async version of the Rust standard library
API Docs | Book | Releases | Contributing
此箱子提供异步版本的std
。它提供了您惯用的所有接口,不同的是,它是异步版本,可使用 Rust 的async
/await
语法。
特征
-
现代: 从头到
std::future
和async/await
开始构建,快速的编译时间。 - **快速:**我们强大的分配器和线程池设计,可提供超高吞吐量,并具有可预见的低延迟。
- **直观:**与 stdlib 的完全对等,意味着您只需要学习一次 API。
- 明确: 详细文档和无障碍指南让,使用异步 Rust 从未如此简单。
例子
use async_std::task;
fn main() {
task::block_on(async {
println!("Hello, world!");
})
}
在我们的网站中,可以在examples
目录找到更多示例,包括网络和文件访问。
哲学
我们认为 Async Rust 应该像 Sync Rust 一样容易上手。我们也相信最好的 API 是您已经知道的 API。最后,我们认为为标准库提供异步副本是最好的做法,而 stdlib 成为性能和生产力两点上,一个可靠的基石。
Async-std 是该愿景的体现。它结合了,单-分配任务的创建,自适应无锁执行器,线程池和网络驱动程序,且使用 Rust 熟悉的 stdlib API,而这样的一个平滑系统,是以如此低延迟的高速度处理工作。
安装
用cargo add安装运行:
$ cargo add async-std
我们还通过 async-std 提供了一组“不稳定”功能。见功能文档中,了解如何启用它们的信息。
执照
Licensed under either of Apache License, Version 2.0 or MIT license at your option.Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.