Function bicoro::chain

source ·
pub fn chain<'a, IA, OA, OB, RA, RB>(
    first: Coroutine<'a, IA, OA, RA>,
    second: Coroutine<'a, OA, OB, RB>
) -> Coroutine<'a, IA, OB, ChainResult<'a, IA, OA, OB, RA, RB>>where
    OA: Send,
    OB: Send,
    RA: Send,
    RB: Send,
Expand description

Feeds the outputs of the first routine into the inputs of the second

As coroutines as more pull based, second is really in charge here, first will ‘run’ whenever second is after more inputs. In the case that first finishes the return result will be provided, and the second coroutine so it can be further ran.

If second finishes, the remaining ‘input’ routine is also returned, allowing it to be used elsewhere