Function packet_stream::packet_stream
[−]
[src]
pub fn packet_stream<R: AsyncRead, W: AsyncWrite, B: AsRef<[u8]>>(
r: R,
w: W
) -> (PsIn<R, W, B>, PsOut<R, W, B>, Done<W, B>)
Take ownership of an AsyncRead and an AsyncWrite to create the two halves of a packet-stream, as well as a future for notification when the read-half of the packet-stream has been closed, errored or is not referenced anymore.
R
is the AsyncRead
for reading bytes from the peer, W
is the
AsyncWrite
for writing bytes to the peer, and B
is the type that is used
as input for sending data.