30个版本

0.3.30 2023年12月24日
0.3.29 2023年10月26日
0.3.28 2023年3月30日
0.3.25 2022年10月20日
0.3.1 2019年11月7日

#97 in 过程宏

Download history 1614841/week @ 2024-03-14 1642658/week @ 2024-03-21 1578611/week @ 2024-03-28 1656028/week @ 2024-04-04 1677165/week @ 2024-04-11 1670122/week @ 2024-04-18 1621584/week @ 2024-04-25 1623626/week @ 2024-05-02 1559461/week @ 2024-05-09 1625778/week @ 2024-05-16 1562260/week @ 2024-05-23 1740073/week @ 2024-05-30 1720192/week @ 2024-06-06 1726167/week @ 2024-06-13 1738241/week @ 2024-06-20 1419252/week @ 2024-06-27

6,939,016 每月下载量
用于 1,350 个crate(3 个直接使用)

MIT/Apache

27KB
542

futures-rs

Rust中的零成本异步编程

Build Status crates.io

文档 | 网站

futures-rs 是一个提供Rust异步编程基础的库。它包括诸如 Stream 之类的关键特质的定义,以及 join!select! 和各种future组合器方法,这些方法能够实现表达式的异步控制流。

使用方法

将以下内容添加到你的 Cargo.toml

[dependencies]
futures = "0.3"

当前 futures 需要 Rust 1.56 或更高版本。

特性 std

Futures-rs可以在不使用标准库的环境中工作,例如在裸机环境中。但是,它的API表面积显著减少。要在 #[no_std] 环境中使用futures-rs,请使用

[dependencies]
futures = { version = "0.3", default-features = false }

许可证

根据您的选择,在以下许可证下发布:[a href="https://github.com/rust-lang/futures-rs/blob/c507ff833728e2979cf5519fc931ea97308ec876/LICENSE-APACHE" rel="ugc noopener">Apache License, Version 2.0MIT license。

除非您明确表示,否则根据Apache-2.0许可证定义的,您有意提交以包含在作品中的任何贡献,都将根据上述许可证双重许可,没有任何额外的条款或条件。


lib.rs:

futures-rs过程宏实现。

依赖关系

~300–760KB
~18K SLoC