Struct packet_stream::PsOut
[−]
[src]
pub struct PsOut<R: AsyncRead, W, B>(_);
Allows sending packets to the peer.
Methods
impl<R, W, B> PsOut<R, W, B> where
R: AsyncRead,
W: AsyncWrite,
B: AsRef<[u8]>, [src]
R: AsyncRead,
W: AsyncWrite,
B: AsRef<[u8]>,
fn request(
&self,
data: B,
t: PsPacketType
) -> (SendRequest<W, B>, InResponse<R>)[src]
&self,
data: B,
t: PsPacketType
) -> (SendRequest<W, B>, InResponse<R>)
Send a request to the peer.
The SendRequest Future must be polled to actually start sending the
request. The InResponse Future can be polled to receive the response.
fn duplex(&self) -> (PsSink<W, B>, PsStream<R>)[src]
Create a PsDuplex, a bidirectional channel multiplexed over the
underlying sink/stream pair.
fn close(&mut self) -> Poll<(), Error>[src]
Close the packet-stream, indicating that no more packets will be sent.
This does not immediately close if there are still unsent requests or
active PsDuplexes. In that case, the closing happens when the last
request is sent or the last duplex is closed.