[][src]Function bichannel::channel

pub fn channel<T, U>() -> (Channel<T, U>, Channel<U, T>)

Creates a bichannelrectional channel returning the left and right sides. Each side can send and receive from its counterpart

Examples

let (left, right) = bichannel::channel::<&'static str, &'static str>();

left.send("ping").unwrap();

assert_eq!(right.recv().unwrap(), "ping");