Trait genawaiter::Generator

source ·
pub trait Generator {
    type Yield;
    type Return;

    // Required method
    fn resume(self: Pin<&mut Self>) -> GeneratorState<Self::Yield, Self::Return>;
}
Expand description

A trait implemented for generator types.

This is modeled after the stdlib’s nightly-only [std::ops::Generator].

Required Associated Types§

source

type Yield

The type of value this generator yields.

source

type Return

The type of value this generator returns upon completion.

Required Methods§

source

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

Resumes the execution of this generator.

Implementors§

source§

impl<C: Coroutine<Resume = ()>> Generator for C

§

type Yield = <C as Coroutine>::Yield

§

type Return = <C as Coroutine>::Return