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.