pub fn suspend<'a, I, O, R, F>(f: F) -> Coroutine<'a, I, O, R>where
F: FnOnce(I) -> Coroutine<'a, I, O, R> + 'a,
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())));