16 个版本
0.2.12 | 2022 年 6 月 26 日 |
---|---|
0.2.11 | 2022 年 3 月 2 日 |
0.2.10 | 2022 年 1 月 25 日 |
0.2.9 | 2021 年 12 月 29 日 |
0.1.3 | 2020 年 7 月 4 日 |
#54 在 异步
54,603 每月下载量
用于 25 个 Crates(11 个直接使用)
35KB
844 行
tokio-pipe
使用 tokio 实现的异步管道(2)库。
示例
use tokio::prelude::*;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let (mut r, mut w) = tokio_pipe::pipe()?;
w.write_all(b"HELLO, WORLD!").await?;
let mut buf = [0; 16];
let len = r.read(&mut buf[..]).await?;
assert_eq!(&buf[..len], &b"HELLO, WORLD!"[..]);
Ok(())
}
许可证
许可协议为
- Apache License,版本 2.0 (LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
- MIT 许可证 (LICENSE-MIT 或 http://opensource.org/licenses/MIT)
由您选择。
贡献
除非您明确声明,否则您有意提交并纳入工作的任何贡献,根据 Apache-2.0 许可证的定义,应双重许可如上所述,无需附加条款或条件。
依赖关系
~2–11MB
~95K SLoC