Crate greentask [] [src]

Library to use coroutines as tasks with own attached data types.

Usage: ```rust strcut In(&'static str); struct Out(&'static str);

let mut resumer = spawn(|mut yielder, first_in| { let second_in = yielder.yield_with(Out("first out")); Out("second out") });

resumer.resume_with(In("first in")); resumer.resume_with(In("second in")); ```

Structs

Resumer

Uses to resume task.

Yielder

Passes to coroutine's context to yield values. This instances dont's creates manually.

Enums

Error

Resume Error

Functions

spawn

Spawns new coroutine.