Trait genawaiter::Coroutine
source · pub trait Coroutine {
type Yield;
type Resume;
type Return;
// Required method
fn resume_with(
self: Pin<&mut Self>,
arg: Self::Resume,
) -> GeneratorState<Self::Yield, Self::Return>;
}
Expand description
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.
Required Associated Types§
Required Methods§
sourcefn resume_with(
self: Pin<&mut Self>,
arg: Self::Resume,
) -> GeneratorState<Self::Yield, Self::Return>
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.