Creates an asynchronous piped reader and writer pair using tokio.rs
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-03 11:08:24 +02:00
examples Make futures default and tokio optional 2021-07-30 15:21:54 +02:00
src Close pipe when dropping reader or writer 2022-03-01 14:43:52 -08:00
.gitignore Ignore 2020-04-03 20:14:11 +05:30
async-pipe-rs.iml Integrate with IntelliJIdea 2020-04-03 20:03:39 +05:30
Cargo.toml chore: sync dependencies (monorepo) 2026-04-03 11:08:24 +02:00
LICENSE Initial commit 2020-04-01 02:03:12 +05:30
README.md Fix panics and unsafe code 2021-07-28 12:23:42 +02:00

async-pipe-rs

crates.io Documentation MIT

Creates an asynchronous piped reader and writer pair using tokio.rs or futures

Docs

Usage

First add this to your Cargo.toml:

[dependencies]
async-pipe = "0.1"

An example:

use async_pipe;
use tokio::prelude::*;

#[tokio::main]
async fn main() {
    let (mut w, mut r) = async_pipe::pipe();

    tokio::spawn(async move {
        w.write_all(b"hello world").await.unwrap();
    });

    let mut v = Vec::new();
    r.read_to_end(&mut v).await.unwrap();
    println!("Received: {:?}", String::from_utf8(v));
}

Contributing

Your PRs and stars are always welcome.