[][src]Module libp2p_core::protocols_handler

Once we are connected to a node, a protocols handler handles one or more specific protocols on this connection.

This includes: how to handle incoming substreams, which protocols are supported, when to open a new outbound substream, and so on.

Each implementation of the ProtocolsHandler trait handles one or more specific protocols. Two ProtocolsHandlers can be combined together with the select() method in order to build a ProtocolsHandler that combines both. This can be repeated multiple times in order to create a handler that handles all the protocols that you wish.

Note: A ProtocolsHandler handles one or more protocols in relation to a specific connection with a remote. In order to handle a protocol that requires knowledge of the network as a whole, see the NetworkBehaviour trait.

Structs

DummyProtocolsHandler

Implementation of ProtocolsHandler that doesn't handle anything.

IntoProtocolsHandlerSelect

Implementation of IntoProtocolsHandler that combines two protocols into one.

MapInEvent

Wrapper around a protocol handler that turns the input event into something else.

MapOutEvent

Wrapper around a protocol handler that turns the output event into something else.

NodeHandlerWrapper

Wraps around an implementation of ProtocolsHandler, and implements NodeHandler.

NodeHandlerWrapperBuilder

Prototype for a NodeHandlerWrapper.

ProtocolsHandlerSelect

Implementation of ProtocolsHandler that combines two protocols into one.

Enums

ProtocolsHandlerEvent

Event produced by a handler.

ProtocolsHandlerUpgrErr

Error that can happen on an outbound substream opening attempt.

Traits

IntoProtocolsHandler

Prototype for a ProtocolsHandler.

ProtocolsHandler

Handler for a set of protocols for a specific connection with a remote.