https://github.com/routerify/async-pipe-rs
Creates an asynchronous piped reader and writer pair using tokio.rs
https://github.com/routerify/async-pipe-rs
async piped rust-lang tokio-rs
Last synced: about 2 months ago
JSON representation
Creates an asynchronous piped reader and writer pair using tokio.rs
- Host: GitHub
- URL: https://github.com/routerify/async-pipe-rs
- Owner: routerify
- License: mit
- Created: 2020-03-31T20:33:11.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-03-04T00:27:39.000Z (over 3 years ago)
- Last Synced: 2025-03-31T07:51:16.446Z (3 months ago)
- Topics: async, piped, rust-lang, tokio-rs
- Language: Rust
- Homepage:
- Size: 49.8 KB
- Stars: 7
- Watchers: 1
- Forks: 10
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# async-pipe-rs
[](https://crates.io/crates/async-pipe)
[](https://docs.rs/async-pipe)
[](./LICENSE)Creates an asynchronous piped reader and writer pair using `tokio.rs` or
`futures`[Docs](https://docs.rs/async-pipe)
## Usage
First add this to your Cargo.toml:
```toml
[dependencies]
async-pipe = "0.1"
```An example:
```rust
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.