new

Function new 

pub fn new(capacity: usize) -> (Sender, Receiver)
Expand description

Create a simplex channel.

The capacity parameter specifies the maximum number of bytes that can be stored in the channel without making the Sender::poll_write return Poll::Pending.

ยงPanics

This function will panic if capacity is zero.