Higher level communication abstractions.
DuplexStream
- An extension of pipes::stream
that allows both sending and receiving.of Channel<T> for DuplexStream<T, U>
of Recv<U> for DuplexStream<T, U>
of Selectable for DuplexStream<T, U>
DuplexStream
- Creates a bidirectional stream.DuplexStream
pub struct DuplexStream <T: Send, U: Send>{
priv chan: Chan<T>,
priv port: Port<U>,
}
An extension of pipes::stream
that allows both sending and receiving.
Channel<T>
for DuplexStream<T, U>
send
fn send(x: T)
try_send
fn try_send(x: T) -> bool
Recv<U>
for DuplexStream<T, U>
recv
fn recv() -> U
try_recv
fn try_recv() -> Option<U>
peek
fn peek() -> bool
Selectable
for DuplexStream<T, U>
header
fn header() -> *pipes::PacketHeader
DuplexStream
fn DuplexStream<T: Send, U: Send>() ->
(DuplexStream<T, U>, DuplexStream<U, T>)
Creates a bidirectional stream.