pub trait Duplex { }Expand description
A trait which indicates a type represents a duplex communication channel, meaning it’s bidirectional and may be used in an interactive manner.
For example, TcpStream is Duplex, however File is not, because
even though File is readable and writable, normal files do not have
independent input and output channels; they share a current-position
pointer. CharDevice is a special kind of file which is Duplex.
Types should implment this, and implementations of HalfDuplex and
FullDuplex (enabled with the “futures-io” cargo feature) will be
provided by blanket implementations.
Implementations on Foreign Types§
impl Duplex for TcpStream
impl Duplex for UnixStream
Available on Unix only.
impl Duplex for CharDevice
Available on crate feature
char-device only.impl Duplex for TTYPort
Available on Unix and crate feature
serialport only.impl Duplex for SocketpairStream
Available on crate feature
socketpair only.impl Duplex for Channel
Available on crate feature
ssh2 only.impl Duplex for Stream
Available on crate feature
ssh2 only.impl<R: Read, W: Write> Duplex for Duplex<R, W>
Available on crate feature
duplexify only.impl<R: Read, W: Write> Duplex for ReadWrite<R, W>
Available on crate feature
readwrite only.