remit-0.1.2 has been yanked.
Remit
Rust generators implemented through async/await syntax.
The pinned implementation is stack-based, and the boxed is heap-based. No fancy macros and a simple API. Values can be lazily or eagerly yielded.
No dependencies outside of std.
Usage
Add to dependencies:
[]
= "0.1.1"
Example code:
use pin;
use ;
async
for item in pin!.of.take
assert_eq!;
/* // Rust has trouble determining the lifetime
assert_eq!(
vec![1],
pin!(Generator::new())
.of(|remit: Remit<'_, usize>| async move { remit.value(1).await; })
.collect::<Vec<_>>(),
);
*/
assert_eq!;
assert_eq!;
async
let expected: = .iter.map.collect;
assert_eq!;
assert_eq!;
License
MIT or APACHE-2, at your option.
See respective LICENSE files.