Function bicoro::suspend[][src]

pub fn suspend<'a, I: 'a, O: 'a, R: 'a>(
    f: Box<dyn FnOnce(I) -> Coroutine<'a, I, O, R> + 'a>
) -> Coroutine<'a, I, O, R>
Expand description

Suspend this coroutine until an input arrives with a function

The function f, will be called on this input see also: recieve()

use bicoro::*;
let co :Coroutine<i32,(),String> = suspend(Box::new(|input:i32| result(input.to_string())));