Enum bicoro::StepResult[][src]

pub enum StepResult<'a, Input, Output, Result> {
    Done(Result),
    Yield {
        output: Output,
        next: Box<Coroutine<'a, Input, Output, Result>>,
    },
    Next(Box<dyn FnOnce(Input) -> Coroutine<'a, Input, Output, Result> + 'a>),
}
Expand description

A step wise evalution of the coroutine

this allows you to ‘iterate’ through until you need to provide input or to observe yields.

In the cause of input, a function is returned, it’s expected the executor will call this with the input.

In the cause of output, a tuple of the output and the remaining coroutine is returned.

In the coroutine is finished, it will be in the done case, so the return value can be extracted

Variants

Done(Result)

Tuple Fields

0: Result

The final value

Yield

Fields

output: Output

The current output being provided to the executor

next: Box<Coroutine<'a, Input, Output, Result>>

The remaining coroutine to process

We have output to give to the executor

Next(Box<dyn FnOnce(Input) -> Coroutine<'a, Input, Output, Result> + 'a>)

Tuple Fields

0: Box<dyn FnOnce(Input) -> Coroutine<'a, Input, Output, Result> + 'a>

The coroutine is suspended, awaiting input

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.