pub fn pipe(cap: usize) -> (Reader, Writer)
Expand description
Creates a bounded single-producer single-consumer pipe.
A pipe is a ring buffer of cap
bytes that can be asynchronously read from and written to.
See the crate-level documentation for more details.
Panics
This function panics if cap
is 0 or if cap * 2
overflows a usize
.