#tokio #pipe #async

tokio-pipe

Asynchronous pipe(2) library using tokio

10 releases

new 0.2.6 Nov 29, 2021
0.2.5 Nov 28, 2021
0.2.1 Jan 24, 2021
0.2.0 Nov 3, 2020
0.1.2 Jun 28, 2020

#83 in Asynchronous

Download history 157/week @ 2021-08-11 272/week @ 2021-08-18 246/week @ 2021-08-25 233/week @ 2021-09-01 421/week @ 2021-09-08 347/week @ 2021-09-15 404/week @ 2021-09-22 395/week @ 2021-09-29 372/week @ 2021-10-06 339/week @ 2021-10-13 486/week @ 2021-10-20 296/week @ 2021-10-27 429/week @ 2021-11-03 477/week @ 2021-11-10 219/week @ 2021-11-17 371/week @ 2021-11-24

1,541 downloads per month
Used in 5 crates

MIT/Apache

25KB
630 lines

tokio-pipe

tokio-pipe dependency status

Asynchronous pipe(2) library using tokio.

Example

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(())
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~2.5MB
~42K SLoC