#tokio #pipe #async #aims #pipe-like

simple-async-pipe

Aims to provide a simple pipe-like functionality for async code

2 releases

0.1.1 Jun 24, 2021
0.1.0 Jun 14, 2021

#976 in Asynchronous

MIT/Apache

8KB
142 lines

simple-async-pipe

Aims to provide a simple pipe-like functionality for async code. Created to be used in tests. No performance optimization done.

Documentation

License

This project is licensed under either of

at your option.


lib.rs:

Aims to provide a simple pipe-like functionality for async code.

Example

    let (mut reader, mut writer) = simple_async_pipe::pipe(64);

    let message = b"hello world";
    writer.write_all(message).await.unwrap();

    let mut buffer = vec![0u8; message.len()];
    reader.read_exact(&mut buffer).await.unwrap();
    assert_eq!(&buffer, message);

Dependencies

~2–3MB
~46K SLoC