Higher level communication abstractions.
DuplexStream
- An extension of pipes::stream
that allows both sending and receiving.for DuplexStream<T, U> where <T: Send, U: Send>
of GenericChan<T> for DuplexStream<T, U> where <T: Send, U: Send>
of GenericSmartChan<T> for DuplexStream<T, U> where <T: Send, U: Send>
of GenericPort<U> for DuplexStream<T, U> where <T: Send, U: Send>
of Peekable<U> for DuplexStream<T, U> where <T: Send, U: Send>
of Selectable for DuplexStream<T, U> where <T: Send, U: Send>
DuplexStream
- Creates a bidirectional stream.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.
DuplexStream<T, U>
where <T: Send, U: Send>
send
fn send(&self, x: T)
try_send
fn try_send(&self, x: T) -> bool
recv
fn recv(&self) -> U
try_recv
fn try_recv(&self) -> Option<U>
peek
fn peek(&self) -> bool
GenericChan<T>
for DuplexStream<T, U>
where <T: Send, U: Send>
send
fn send(&self, x: T)
GenericSmartChan<T>
for DuplexStream<T, U>
where <T: Send, U: Send>
try_send
fn try_send(&self, x: T) -> bool
GenericPort<U>
for DuplexStream<T, U>
where <T: Send, U: Send>
recv
fn recv(&self) -> U
try_recv
fn try_recv(&self) -> Option<U>
Peekable<U>
for DuplexStream<T, U>
where <T: Send, U: Send>
peek
fn peek(&self) -> bool
Selectable
for DuplexStream<T, U>
where <T: Send, U: Send>
header
fn header(&mut self) -> *mut pipes::PacketHeader
DuplexStream
fn DuplexStream<T: Send, U: Send>() ->
(DuplexStream<T, U>, DuplexStream<U, T>)
Creates a bidirectional stream.