[][src]Macro genawaiter::sync_producer

macro_rules! sync_producer {
    #[proc_macro_hack] => { ... };
}

Creates a producer for use with sync::Gen.

A producer can later be turned into a generator using Gen::new.

This macro takes one argument, which should be a block containing one or more calls to yield_!.

Example

use genawaiter::{sync::Gen, sync_producer as producer, yield_};

let my_producer = producer!({
    yield_!(10);
});

let mut my_generator = Gen::new(my_producer);