Function generator::get_yield

source ·
pub fn get_yield<A: Any>() -> Option<A>
👎Deprecated since 0.6.18: please use scope version instead
Expand description

get the passed in para

Examples found in repository?
examples/get_yield.rs (line 8)
4
5
6
7
8
9
10
11
12
13
14
fn sum(a: u32) -> u32 {
    let mut sum = a;
    let mut recv: u32;
    while sum < 200 {
        recv = get_yield().unwrap();
        yield_with(sum);
        sum += recv;
    }

    sum
}