1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! This crate provides a way to implement something like C#'s `yield return` using an asynchronous function.
//!
//! # Example
//!
//! ```
//! use yield_return::Yield;
//! let iter = Yield::new(|mut y| async move {
//! y.ret(1).await;
//! y.ret(2).await;
//! });
//! let list: Vec<_> = iter.collect();
//! assert_eq!(list, vec![1, 2]);
//! ```
//!
//! ## Available Types
//!
//! This crate provides several iterator types that differ based on two characteristics:
//!
//! - Whether they implement [`Iterator`] or [`Stream`]
//! - Whether they require and implement [`Send`]
//!
//! The following table shows the available types:
//!
//! | | `Send` | Not `Send` |
//! | ------------ | ------------- | ------------------ |
//! | [`Iterator`] | [`Iter`] | [`LocalIter`] |
//! | [`Stream`] | [`AsyncIter`] | [`LocalAsyncIter`] |
//!
//! [`Stream`]: futures_core::stream::Stream
pub use ;
pub use ;
pub type Yield<'a, T> = ;
pub type YieldContext<T> = ;