pub fn channel<T>(capacity: usize) -> (Sender<T>, Receiver<T>)where
    T: Send,
Expand description

Creates a new channel with the given buffering capacity

Uses a GrowingHeapBuf whose capacity grows dynamically up to the given limit. Refer to generic_channel and GrowingHeapBuf for more information.

let (sender, receiver) = channel::<i32>(4);