yield-return-rs
Implement a coroutine like C#'s yield return
using Rust's async
, await
.
Example
use Iter;
let iter = new;
let list: = iter.collect;
assert_eq!;
Available Types
This crate provides several iterator types that differ based on two characteristics:
- Whether they implement
Iterator
orStream
- Whether they require and implement
Send
The following table shows the available types:
Send |
Not Send |
|
---|---|---|
Iterator |
Iter |
LocalIter |
Stream |
AsyncIter |
LocalAsyncIter |
Compare with other crates
While async-stream and genawaiter serve similar purposes, yield-return focuses on usability over performance. This design philosophy is reflected in two key characteristics:
- Type parameters only expose the external interface, not implementation details
- Clean API using only types and functions (no macros)
License
This project is dual licensed under Apache-2.0/MIT. See the two LICENSE-* files for details.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.