Higher level communication abstractions.

Struct 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.

Implementation of Channel<T> for DuplexStream<T, U>

Method send

fn send(x: T)

Method try_send

fn try_send(x: T) -> bool

Implementation of Recv<U> for DuplexStream<T, U>

Method recv

fn recv() -> U

Method try_recv

fn try_recv() -> Option<U>

Method peek

fn peek() -> bool

Implementation of Selectable for DuplexStream<T, U>

Method header

fn header() -> *pipes::PacketHeader

Function DuplexStream

fn DuplexStream<T: Send, U: Send>() ->
   (DuplexStream<T, U>, DuplexStream<U, T>)

Creates a bidirectional stream.