[go: up one dir, main page]

yield_with

Function yield_with 

Source
pub fn yield_with<T: Any>(v: T)
👎Deprecated since 0.6.18: please use scope version instead
Expand description

yield something without catch passed in para

Examples found in repository?
examples/yield_from.rs (line 7)
5fn xrange(start: u32, end: u32) -> u32 {
6    for i in start..end {
7        yield_with(i);
8    }
9    done!();
10}
More examples
Hide additional examples
examples/get_yield.rs (line 9)
4fn sum(a: u32) -> u32 {
5    let mut sum = a;
6    let mut recv: u32;
7    while sum < 200 {
8        recv = get_yield().unwrap();
9        yield_with(sum);
10        sum += recv;
11    }
12
13    sum
14}