Function channel
fn channel<T>() -> (Sender<T>, Receiver<T>)
Creates a new one-shot channel for sending a single value across asynchronous tasks.
The channel works for a spsc (single-producer, single-consumer) scheme.
This function is similar to Rust's channel constructor found in the standard
library. Two halves are returned, the first of which is a Sender handle,
used to signal the end of a computation and provide its value. The second
half is a Receiver which implements the Future trait, resolving to the
value that was given to the Sender handle.
Each half can be separately owned and sent across tasks.
Examples
use oneshot;
use ;
let = ;
spawn;
println!;
block_on;