[−][src]Trait context_coroutine::Coroutine
A trait that stackful coroutines should implement.
Associated Types
type StartArguments: Sized
Type of the arguments the coroutine is initially called with, eg (usize, String)
.
type ResumeArguments: Sized
Type of the arguments the coroutine is resumed with, eg (u8, Vec<f64>)
.
type Yields: Sized
Type of the result from a yield of the coroutine.
type Complete: Sized
Type of the final result from the coroutine.
Required methods
fn coroutine<'yielder>(
start_arguments: Self::StartArguments,
yielder: Yielder<'yielder, Self::ResumeArguments, Self::Yields, Self::Complete>
) -> Self::Complete
start_arguments: Self::StartArguments,
yielder: Yielder<'yielder, Self::ResumeArguments, Self::Yields, Self::Complete>
) -> Self::Complete
Implement this for the coroutine's behaviour.
Panics inside the coroutine are transferred to the calling thread and raised.