transform-stream

Crates.io MIT licensed Docs CI Unsafe Forbidden

Lightweight async stream wrapper.

Usage

```rust use transformstream::{trystream, AsyncTryStream}; use futures::StreamExt; use std::io;

let stream: AsyncTryStream, io::Error, > = trystream!{ yield!(vec![b'1', b'2']); yield!(vec![b'3', b'4']); Ok(()) };

futures::executor::blockon(async { futures::pinmut!(stream); asserteq!(stream.next().await.unwrap().unwrap(), vec![b'1', b'2']); asserteq!(stream.next().await.unwrap().unwrap(), vec![b'3', b'4']); assert!(stream.next().await.is_none()); }); ```