Higher level communication abstractions.

Struct DuplexStream

pub struct DuplexStream<T, U> {
    priv chan: Chan<T>,
    priv port: Port<U>,
}

An extension of pipes::stream that allows both sending and receiving.

Implementation for DuplexStream<T, U> where <T: Owned, U: Owned>

Method send

fn send(&self, x: T)

Method try_send

fn try_send(&self, x: T) -> bool

Method recv

fn recv(&self) -> U

Method try_recv

fn try_recv(&self) -> Option<U>

Method peek

fn peek(&self) -> bool

Implementation of GenericChan<T> for DuplexStream<T, U> where <T: Owned, U: Owned>

Method send

fn send(&self, x: T)

Implementation of GenericSmartChan<T> for DuplexStream<T, U> where <T: Owned, U: Owned>

Method try_send

fn try_send(&self, x: T) -> bool

Implementation of GenericPort<U> for DuplexStream<T, U> where <T: Owned, U: Owned>

Method recv

fn recv(&self) -> U

Method try_recv

fn try_recv(&self) -> Option<U>

Implementation of Peekable<U> for DuplexStream<T, U> where <T: Owned, U: Owned>

Method peek

fn peek(&self) -> bool

Implementation of Selectable for DuplexStream<T, U> where <T: Owned, U: Owned>

Method header

fn header(&self) -> *pipes::PacketHeader

Function DuplexStream

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

Creates a bidirectional stream.