pub fn chan<T: Send + 'static>(cap: usize) -> (Sender<T>, Receiver<T>)Expand description
Create a new channel with the given buffer capacity.
cap == 0 gives an unbuffered (synchronous rendezvous) channel; cap > 0
gives a buffered channel that holds up to cap values without blocking the
sender.
Returns (Sender<T>, Receiver<T>).