Function bicoro::intercept_output

source ·
pub fn intercept_output<'a, Input, OutputA, OutputB, Transform, Result>(
    co: Coroutine<'a, Input, OutputA, Result>,
    transform: Transform
) -> Coroutine<'a, Input, OutputB, Result>where
    Transform: Fn(OutputA) -> Coroutine<'a, Input, OutputB, ()> + Send + 'a,
    Result: Send,
    OutputA: Send,
Expand description

Transforms the output of coroutine A into B

This requires a coroutine that can map B outputs into a, as this is similar to running ‘co’ in the context of the output

This is a specialization of run_child

TLDR; change output with the output transform function