Skip to content

simtropolis/async-pipe-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%