Crate packet_stream [] [src]

Implements the packet-stream protocol in rust.

Structs

ClosePs

Future for closing the packet-stream, indicating that no more packets will be sent.

Done

A future that emits the wrapped writer of a packet-stream once the outgoing half of the stream has been fully closed, it has errored, or once all references to it have been dropped.

Metadata

The metadata associated with a packet.

PeerRequest

A request initated by the peer. Drop to ignore it, or use respond to send a response.

PeerResponse

Future that completes when the response has been sent to the peer.

PsIn

A stream of incoming requests from the peer.

PsOut

Allows sending packets to the peer.

PsSink

The sink half of a duplex multiplexed over the packet-stream.

PsStream

The stream half of a duplex multiplexed over the packet-stream.

Request

An outgoing request, initated by this packet-stream.

Response

A response that will be received from the peer.

Enums

ConnectionError

An error indicating what happend on a connection.

IncomingPacket

An incoming packet, initiated by the peer.

PacketType

An enumeration representing the different types a packet can have.

Functions

packet_stream

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.