Struct libp2p_swarm::protocols_handler::NodeHandlerWrapper
source · [−]pub struct NodeHandlerWrapper<TProtoHandler> where
TProtoHandler: ProtocolsHandler, { /* private fields */ }
Expand description
Wraps around an implementation of ProtocolsHandler
, and implements NodeHandler
.
Trait Implementations
impl<TProtoHandler> ConnectionHandler for NodeHandlerWrapper<TProtoHandler> where
TProtoHandler: ProtocolsHandler,
impl<TProtoHandler> ConnectionHandler for NodeHandlerWrapper<TProtoHandler> where
TProtoHandler: ProtocolsHandler,
The inbound type of events used to notify the handler through the Network
. Read more
The outbound type of events that the handler emits to the Network
through ConnectionHandler::poll
. Read more
type Error = NodeHandlerWrapperError<TProtoHandler::Error>
type Error = NodeHandlerWrapperError<TProtoHandler::Error>
The type of errors that the handler can produce when polled by the Network
.
type Substream = Substream<StreamMuxerBox>
type Substream = Substream<StreamMuxerBox>
The type of the substream containing the data.
type OutboundOpenInfo = (u64, TProtoHandler::OutboundOpenInfo, Duration)
type OutboundOpenInfo = (u64, TProtoHandler::OutboundOpenInfo, Duration)
Information about a substream. Can be sent to the handler through a SubstreamEndpoint
,
and will be passed back in inject_substream
or inject_outbound_closed
. Read more
fn inject_substream(
&mut self,
substream: Self::Substream,
endpoint: SubstreamEndpoint<Self::OutboundOpenInfo>
)
fn inject_substream(
&mut self,
substream: Self::Substream,
endpoint: SubstreamEndpoint<Self::OutboundOpenInfo>
)
Sends a new substream to the handler. Read more
Notifies the handler of an event.
Notifies the handler of a change in the address of the remote.
fn poll(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<ConnectionHandlerEvent<Self::OutboundOpenInfo, Self::OutEvent>, Self::Error>>
fn poll(
&mut self,
cx: &mut Context<'_>
) -> Poll<Result<ConnectionHandlerEvent<Self::OutboundOpenInfo, Self::OutEvent>, Self::Error>>
Polls the handler for events. Read more