[][src]Trait genawaiter::Coroutine

pub trait Coroutine {
    type Yield;
    type Resume;
    type Return;
    fn resume_with(
        self: Pin<&mut Self>,
        arg: Self::Resume
    ) -> GeneratorState<Self::Yield, Self::Return>; }

A trait implemented for coroutines.

A Coroutine is a generalization of a Generator. A Generator constrains the resume argument type to (), but in a Coroutine it can be anything.

Associated Types

type Yield

The type of value this generator yields.

type Resume

The type of value this generator accepts as a resume argument.

type Return

The type of value this generator returns upon completion.

Loading content...

Required methods

fn resume_with(
    self: Pin<&mut Self>,
    arg: Self::Resume
) -> GeneratorState<Self::Yield, Self::Return>

Resumes the execution of this generator.

The argument will be passed into the coroutine as a resume argument.

Loading content...

Implementors

impl<'s, Y, R, F: Future> Coroutine for genawaiter::stack::Gen<'s, Y, R, F>[src]

type Yield = Y

type Resume = R

type Return = F::Output

impl<Y, R, F: Future> Coroutine for genawaiter::rc::Gen<Y, R, F>[src]

type Yield = Y

type Resume = R

type Return = F::Output

impl<Y, R, F: Future> Coroutine for genawaiter::sync::Gen<Y, R, F>[src]

type Yield = Y

type Resume = R

type Return = F::Output

Loading content...