Module pea2pea::protocols[][src]

Expand description

Opt-in protocols available to the Node; each protocol is expected to spawn its own task that runs throughout the Node’s lifetime and handles a specific functionality. The communication with these tasks is done via dedicated handler objects.

Structs

The handler object dedicated to the Disconnect protocol.

The handler object dedicated to the Handshake protocol.

The handler object dedicated to the Reading protocol.

The handler object dedicated to the Writing protocol.

Traits

Can be used to automatically perform some extra actions when the node disconnects from its peer, which is especially practical if the disconnect is triggered automatically, e.g. due to the peer exceeding the allowed number of failures or severing its connection with the node on its own.

Can be used to specify and enable network handshakes. Upon establishing a connection, both sides will need to adhere to the specified handshake rules in order to finalize the connection and be able to send or receive any messages.

Can be used to specify and enable reading, i.e. receiving inbound messages. If Handshake is enabled too, it goes into force only after the handshake has been concluded.

Can be used to specify and enable writing, i.e. sending outbound messages. If the Handshake protocol is enabled too, it goes into force only after the handshake has been concluded.

Type Definitions

An object sent to a protocol handler task; the task assumes control of a protocol-relevant item T, and when it’s done with it, it returns it (possibly in a wrapper object) or another relevant object to the callsite via the counterpart oneshot::Receiver.