#tokio #pipe #async

tokio-pipe

Asynchronous pipe(2) library using tokio

16 releases

0.2.12 Jun 26, 2022
0.2.11 Mar 2, 2022
0.2.10 Jan 25, 2022
0.2.9 Dec 29, 2021
0.1.3 Jul 4, 2020

#83 in Asynchronous

Download history 9285/week @ 2025-01-28 25182/week @ 2025-02-04 104105/week @ 2025-02-11 114661/week @ 2025-02-18 118114/week @ 2025-02-25 117998/week @ 2025-03-04 109370/week @ 2025-03-11 37093/week @ 2025-03-18 81067/week @ 2025-03-25 69492/week @ 2025-04-01 67235/week @ 2025-04-08 54920/week @ 2025-04-15 51212/week @ 2025-04-22 63943/week @ 2025-04-29 58051/week @ 2025-05-06 46401/week @ 2025-05-13

226,056 downloads per month
Used in 20 crates (11 directly)

MIT/Apache

35KB
844 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–10MB
~91K SLoC