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]>,
pub fn request(&self, data: B, t: PacketType) -> (Request<W, B>, Response<R>)[src]
Obtain a future for sending a request to the peer.
pub fn duplex(&self) -> (PsSink<W, B>, PsStream<R>)[src]
Create a bidirectional channel multiplexed over the underlying
AsyncRead/AsyncWrite pair.
pub fn close(self) -> ClosePs<R, W, B>[src]
Close the packet-stream, indicating that no more packets will be sent.
This does not immediately close if there are still unfinished
Requests, PeerResponses or PsSinks. In that case, the closing
happens when the last of them finishes.
The error contains a None if an Request, PeerResponse or
PsSink errored previously.