pub fn new<F, S, R>() -> (S, R)where
F: Flavor + FlavorNew + FlavorMP,
S: SenderType<Flavor = F> + Clone,
R: ReceiverType<Flavor = F> + NotCloneable,Expand description
The generic builder for all mpsc channel types with a new method (except Array).
Initialize sender and receiver types from a flavor type, you can let the compiler to infer the type according to return type signature. (the falvor might have different new() method, but the rest is the same.
ยงExamples
use crossfire::*;
let (tx, rx): (MTx<_>, Rx<_>) = mpsc::new::<mpsc::List<i32>, _, _>();
let (tx, rx): (MAsyncTx<mpsc::One<usize>>, Rx<mpsc::One<usize>>) = mpsc::new();