Trait libp2p::swarm::protocols_handler::ProtocolsHandler [−][src]
A handler for a set of protocols used on a connection with a remote.
This trait should be implemented for a type that maintains the state for the execution of a specific protocol with a remote.
Handling a protocol
Communication with a remote over a set of protocols is initiated in one of two ways:
-
Dialing by initiating a new outbound substream. In order to do so,
ProtocolsHandler::poll()
must return anProtocolsHandlerEvent::OutboundSubstreamRequest
, providing an instance oflibp2p_core::upgrade::OutboundUpgrade
that is used to negotiate the protocol(s). Upon success,ProtocolsHandler::inject_fully_negotiated_outbound
is called with the final output of the upgrade. -
Listening by accepting a new inbound substream. When a new inbound substream is created on a connection,
ProtocolsHandler::listen_protocol
is called to obtain an instance oflibp2p_core::upgrade::InboundUpgrade
that is used to negotiate the protocol(s). Upon success,ProtocolsHandler::inject_fully_negotiated_inbound
is called with the final output of the upgrade.
Connection Keep-Alive
A ProtocolsHandler
can influence the lifetime of the underlying connection
through ProtocolsHandler::connection_keep_alive
. That is, the protocol
implemented by the handler can include conditions for terminating the connection.
The lifetime of successfully negotiated substreams is fully controlled by the handler.
Implementors of this trait should keep in mind that the connection can be closed at any time. When a connection is closed gracefully, the substreams used by the handler may still continue reading data until the remote closes its side of the connection.
Associated Types
type InEvent: 'static + Send
[src]
Custom event that can be received from the outside.
type OutEvent: 'static + Send
[src]
Custom event that can be produced by the handler and that will be returned to the outside.
type Error: 'static + Error + Send
[src]
The type of errors returned by ProtocolsHandler::poll
.
type InboundProtocol: 'static + InboundUpgradeSend + Send
[src]
The inbound upgrade for the protocol(s) used by the handler.
type OutboundProtocol: OutboundUpgradeSend
[src]
The outbound upgrade for the protocol(s) used by the handler.
type InboundOpenInfo: 'static + Send
[src]
The type of additional information returned from listen_protocol
.
type OutboundOpenInfo: 'static + Send
[src]
The type of additional information passed to an OutboundSubstreamRequest
.
Required methods
pub fn listen_protocol(
&self
) -> SubstreamProtocol<Self::InboundProtocol, Self::InboundOpenInfo>
[src]
&self
) -> SubstreamProtocol<Self::InboundProtocol, Self::InboundOpenInfo>
The InboundUpgrade
to apply on inbound
substreams to negotiate the desired protocols.
Note: The returned
InboundUpgrade
should always accept all the generally supported protocols, even if in a specific context a particular one is not supported, (eg. when only allowing one substream at a time for a protocol). This allows a remote to put the list of supported protocols in a cache.
pub fn inject_fully_negotiated_inbound(
&mut self,
protocol: <Self::InboundProtocol as InboundUpgradeSend>::Output,
info: Self::InboundOpenInfo
)
[src]
&mut self,
protocol: <Self::InboundProtocol as InboundUpgradeSend>::Output,
info: Self::InboundOpenInfo
)
Injects the output of a successful upgrade on a new inbound substream.
pub fn inject_fully_negotiated_outbound(
&mut self,
protocol: <Self::OutboundProtocol as OutboundUpgradeSend>::Output,
info: Self::OutboundOpenInfo
)
[src]
&mut self,
protocol: <Self::OutboundProtocol as OutboundUpgradeSend>::Output,
info: Self::OutboundOpenInfo
)
Injects the output of a successful upgrade on a new outbound substream.
The second argument is the information that was previously passed to
ProtocolsHandlerEvent::OutboundSubstreamRequest
.
pub fn inject_event(&mut self, event: Self::InEvent)
[src]
Injects an event coming from the outside in the handler.
pub fn inject_dial_upgrade_error(
&mut self,
info: Self::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgradeSend>::Error>
)
[src]
&mut self,
info: Self::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgradeSend>::Error>
)
Indicates to the handler that upgrading an outbound substream to the given protocol has failed.
pub fn connection_keep_alive(&self) -> KeepAlive
[src]
Returns until when the connection should be kept alive.
This method is called by the Swarm
after each invocation of
ProtocolsHandler::poll
to determine if the connection and the associated
ProtocolsHandler
s should be kept alive as far as this handler is concerned
and if so, for how long.
Returning KeepAlive::No
indicates that the connection should be
closed and this handler destroyed immediately.
Returning KeepAlive::Until
indicates that the connection may be closed
and this handler destroyed after the specified Instant
.
Returning KeepAlive::Yes
indicates that the connection should
be kept alive until the next call to this method.
Note: The connection is always closed and the handler destroyed when
ProtocolsHandler::poll
returns an error. Furthermore, the connection may be closed for reasons outside of the control of the handler.
pub fn poll(
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, Self::OutEvent, Self::Error>>
[src]
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, Self::OutEvent, Self::Error>>
Should behave like Stream::poll()
.
Provided methods
pub fn inject_address_change(&mut self, _new_address: &Multiaddr)
[src]
Notifies the handler of a change in the address of the remote.
pub fn inject_listen_upgrade_error(
&mut self,
Self::InboundOpenInfo,
ProtocolsHandlerUpgrErr<<Self::InboundProtocol as InboundUpgradeSend>::Error>
)
[src]
&mut self,
Self::InboundOpenInfo,
ProtocolsHandlerUpgrErr<<Self::InboundProtocol as InboundUpgradeSend>::Error>
)
Indicates to the handler that upgrading an inbound substream to the given protocol has failed.
pub fn map_in_event<TNewIn, TMap>(
self,
map: TMap
) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
self,
map: TMap
) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
Adds a closure that turns the input event into something else.
pub fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
Adds a closure that turns the output event into something else.
pub fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
Creates a new ProtocolsHandler
that selects either this handler or
other
by delegating methods calls appropriately.
Note: The largest
KeepAlive
returned by the two handlers takes precedence, i.e. is returned fromProtocolsHandler::connection_keep_alive
by the returned handler.
pub fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
Creates a builder that allows creating a NodeHandler
that handles this protocol
exclusively.
Note: This method should not be redefined in a custom
ProtocolsHandler
.
Implementors
impl ProtocolsHandler for PingHandler
[src]
type InEvent = Void
type OutEvent = Result<PingSuccess, PingFailure>
type Error = PingFailure
type InboundProtocol = Ping
type OutboundProtocol = Ping
type OutboundOpenInfo = ()
type InboundOpenInfo = ()
pub fn listen_protocol(&self) -> SubstreamProtocol<Ping, ()>
[src]
pub fn inject_fully_negotiated_inbound(
&mut self,
stream: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
()
)
[src]
&mut self,
stream: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
()
)
pub fn inject_fully_negotiated_outbound(
&mut self,
stream: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
()
)
[src]
&mut self,
stream: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
()
)
pub fn inject_event(&mut self, Void)
[src]
pub fn inject_dial_upgrade_error(
&mut self,
_info: (),
error: ProtocolsHandlerUpgrErr<Void>
)
[src]
&mut self,
_info: (),
error: ProtocolsHandlerUpgrErr<Void>
)
pub fn connection_keep_alive(&self) -> KeepAlive
[src]
pub fn poll(
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<Ping, (), Result<PingSuccess, PingFailure>, <PingHandler as ProtocolsHandler>::Error>>
[src]
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<Ping, (), Result<PingSuccess, PingFailure>, <PingHandler as ProtocolsHandler>::Error>>
impl ProtocolsHandler for DummyProtocolsHandler
[src]
type InEvent = Void
type OutEvent = Void
type Error = Void
type InboundProtocol = DeniedUpgrade
type OutboundProtocol = DeniedUpgrade
type OutboundOpenInfo = Void
type InboundOpenInfo = ()
pub fn listen_protocol(
&self
) -> SubstreamProtocol<<DummyProtocolsHandler as ProtocolsHandler>::InboundProtocol, <DummyProtocolsHandler as ProtocolsHandler>::InboundOpenInfo>
[src]
&self
) -> SubstreamProtocol<<DummyProtocolsHandler as ProtocolsHandler>::InboundProtocol, <DummyProtocolsHandler as ProtocolsHandler>::InboundOpenInfo>
pub fn inject_fully_negotiated_inbound(
&mut self,
<<DummyProtocolsHandler as ProtocolsHandler>::InboundProtocol as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output,
<DummyProtocolsHandler as ProtocolsHandler>::InboundOpenInfo
)
[src]
&mut self,
<<DummyProtocolsHandler as ProtocolsHandler>::InboundProtocol as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output,
<DummyProtocolsHandler as ProtocolsHandler>::InboundOpenInfo
)
pub fn inject_fully_negotiated_outbound(
&mut self,
<<DummyProtocolsHandler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output,
<DummyProtocolsHandler as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
<<DummyProtocolsHandler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output,
<DummyProtocolsHandler as ProtocolsHandler>::OutboundOpenInfo
)
pub fn inject_event(
&mut self,
<DummyProtocolsHandler as ProtocolsHandler>::InEvent
)
[src]
&mut self,
<DummyProtocolsHandler as ProtocolsHandler>::InEvent
)
pub fn inject_address_change(&mut self, &Multiaddr)
[src]
pub fn inject_dial_upgrade_error(
&mut self,
<DummyProtocolsHandler as ProtocolsHandler>::OutboundOpenInfo,
ProtocolsHandlerUpgrErr<<<DummyProtocolsHandler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>
)
[src]
&mut self,
<DummyProtocolsHandler as ProtocolsHandler>::OutboundOpenInfo,
ProtocolsHandlerUpgrErr<<<DummyProtocolsHandler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>
)
pub fn inject_listen_upgrade_error(
&mut self,
<DummyProtocolsHandler as ProtocolsHandler>::InboundOpenInfo,
ProtocolsHandlerUpgrErr<<<DummyProtocolsHandler as ProtocolsHandler>::InboundProtocol as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>
)
[src]
&mut self,
<DummyProtocolsHandler as ProtocolsHandler>::InboundOpenInfo,
ProtocolsHandlerUpgrErr<<<DummyProtocolsHandler as ProtocolsHandler>::InboundProtocol as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>
)
pub fn connection_keep_alive(&self) -> KeepAlive
[src]
pub fn poll(
&mut self,
&mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<DummyProtocolsHandler as ProtocolsHandler>::OutboundProtocol, <DummyProtocolsHandler as ProtocolsHandler>::OutboundOpenInfo, <DummyProtocolsHandler as ProtocolsHandler>::OutEvent, <DummyProtocolsHandler as ProtocolsHandler>::Error>>
[src]
&mut self,
&mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<DummyProtocolsHandler as ProtocolsHandler>::OutboundProtocol, <DummyProtocolsHandler as ProtocolsHandler>::OutboundOpenInfo, <DummyProtocolsHandler as ProtocolsHandler>::OutEvent, <DummyProtocolsHandler as ProtocolsHandler>::Error>>
impl<K, H> ProtocolsHandler for MultiHandler<K, H> where
K: Clone + Hash + Eq + Send + 'static,
H: ProtocolsHandler,
<H as ProtocolsHandler>::InboundProtocol: InboundUpgradeSend,
<H as ProtocolsHandler>::OutboundProtocol: OutboundUpgradeSend,
[src]
K: Clone + Hash + Eq + Send + 'static,
H: ProtocolsHandler,
<H as ProtocolsHandler>::InboundProtocol: InboundUpgradeSend,
<H as ProtocolsHandler>::OutboundProtocol: OutboundUpgradeSend,
type InEvent = (K, <H as ProtocolsHandler>::InEvent)
type OutEvent = (K, <H as ProtocolsHandler>::OutEvent)
type Error = <H as ProtocolsHandler>::Error
type InboundProtocol = Upgrade<K, <H as ProtocolsHandler>::InboundProtocol>
type OutboundProtocol = <H as ProtocolsHandler>::OutboundProtocol
type InboundOpenInfo = Info<K, <H as ProtocolsHandler>::InboundOpenInfo>
type OutboundOpenInfo = (K, <H as ProtocolsHandler>::OutboundOpenInfo)
pub fn listen_protocol(
&self
) -> SubstreamProtocol<<MultiHandler<K, H> as ProtocolsHandler>::InboundProtocol, <MultiHandler<K, H> as ProtocolsHandler>::InboundOpenInfo>
[src]
&self
) -> SubstreamProtocol<<MultiHandler<K, H> as ProtocolsHandler>::InboundProtocol, <MultiHandler<K, H> as ProtocolsHandler>::InboundOpenInfo>
pub fn inject_fully_negotiated_outbound(
&mut self,
protocol: <<MultiHandler<K, H> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
<MultiHandler<K, H> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: <<MultiHandler<K, H> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
<MultiHandler<K, H> as ProtocolsHandler>::OutboundOpenInfo
)
pub fn inject_fully_negotiated_inbound(
&mut self,
<<MultiHandler<K, H> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
info: <MultiHandler<K, H> as ProtocolsHandler>::InboundOpenInfo
)
[src]
&mut self,
<<MultiHandler<K, H> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
info: <MultiHandler<K, H> as ProtocolsHandler>::InboundOpenInfo
)
pub fn inject_event(
&mut self,
<MultiHandler<K, H> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
<MultiHandler<K, H> as ProtocolsHandler>::InEvent
)
pub fn inject_address_change(&mut self, addr: &Multiaddr)
[src]
pub fn inject_dial_upgrade_error(
&mut self,
<MultiHandler<K, H> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MultiHandler<K, H> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
[src]
&mut self,
<MultiHandler<K, H> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MultiHandler<K, H> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
pub fn inject_listen_upgrade_error(
&mut self,
info: <MultiHandler<K, H> as ProtocolsHandler>::InboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MultiHandler<K, H> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Error>
)
[src]
&mut self,
info: <MultiHandler<K, H> as ProtocolsHandler>::InboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MultiHandler<K, H> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Error>
)
pub fn connection_keep_alive(&self) -> KeepAlive
[src]
pub fn poll(
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<MultiHandler<K, H> as ProtocolsHandler>::OutboundProtocol, <MultiHandler<K, H> as ProtocolsHandler>::OutboundOpenInfo, <MultiHandler<K, H> as ProtocolsHandler>::OutEvent, <MultiHandler<K, H> as ProtocolsHandler>::Error>>
[src]
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<MultiHandler<K, H> as ProtocolsHandler>::OutboundProtocol, <MultiHandler<K, H> as ProtocolsHandler>::OutboundOpenInfo, <MultiHandler<K, H> as ProtocolsHandler>::OutEvent, <MultiHandler<K, H> as ProtocolsHandler>::Error>>
impl<TInbound, TOutbound, TEvent> ProtocolsHandler for OneShotHandler<TInbound, TOutbound, TEvent> where
TInbound: InboundUpgradeSend + Send + 'static,
TOutbound: OutboundUpgradeSend,
TEvent: Send + 'static,
<TInbound as InboundUpgradeSend>::Output: Into<TEvent>,
<TOutbound as OutboundUpgradeSend>::Output: Into<TEvent>,
<TOutbound as OutboundUpgradeSend>::Error: Error,
<TOutbound as OutboundUpgradeSend>::Error: Send,
<TOutbound as OutboundUpgradeSend>::Error: 'static,
SubstreamProtocol<TInbound, ()>: Clone,
[src]
TInbound: InboundUpgradeSend + Send + 'static,
TOutbound: OutboundUpgradeSend,
TEvent: Send + 'static,
<TInbound as InboundUpgradeSend>::Output: Into<TEvent>,
<TOutbound as OutboundUpgradeSend>::Output: Into<TEvent>,
<TOutbound as OutboundUpgradeSend>::Error: Error,
<TOutbound as OutboundUpgradeSend>::Error: Send,
<TOutbound as OutboundUpgradeSend>::Error: 'static,
SubstreamProtocol<TInbound, ()>: Clone,
type InEvent = TOutbound
type OutEvent = TEvent
type Error = ProtocolsHandlerUpgrErr<<<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
type InboundProtocol = TInbound
type OutboundProtocol = TOutbound
type OutboundOpenInfo = ()
type InboundOpenInfo = ()
pub fn listen_protocol(
&self
) -> SubstreamProtocol<<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::InboundProtocol, <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::InboundOpenInfo>
[src]
&self
) -> SubstreamProtocol<<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::InboundProtocol, <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::InboundOpenInfo>
pub fn inject_fully_negotiated_inbound(
&mut self,
out: <<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::InboundOpenInfo
)
[src]
&mut self,
out: <<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::InboundOpenInfo
)
pub fn inject_fully_negotiated_outbound(
&mut self,
out: <<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
out: <<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundOpenInfo
)
pub fn inject_event(
&mut self,
event: <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
event: <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::InEvent
)
pub fn inject_dial_upgrade_error(
&mut self,
_info: <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
[src]
&mut self,
_info: <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
pub fn connection_keep_alive(&self) -> KeepAlive
[src]
pub fn poll(
&mut self,
&mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundProtocol, <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundOpenInfo, <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutEvent, <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::Error>>
[src]
&mut self,
&mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundProtocol, <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutboundOpenInfo, <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::OutEvent, <OneShotHandler<TInbound, TOutbound, TEvent> as ProtocolsHandler>::Error>>
impl<TInner> ProtocolsHandler for ToggleProtoHandler<TInner> where
TInner: ProtocolsHandler,
[src]
TInner: ProtocolsHandler,
type InEvent = <TInner as ProtocolsHandler>::InEvent
type OutEvent = <TInner as ProtocolsHandler>::OutEvent
type Error = <TInner as ProtocolsHandler>::Error
type InboundProtocol = EitherUpgrade<SendWrapper<<TInner as ProtocolsHandler>::InboundProtocol>, SendWrapper<DeniedUpgrade>>
type OutboundProtocol = <TInner as ProtocolsHandler>::OutboundProtocol
type OutboundOpenInfo = <TInner as ProtocolsHandler>::OutboundOpenInfo
type InboundOpenInfo = Either<<TInner as ProtocolsHandler>::InboundOpenInfo, ()>
pub fn listen_protocol(
&self
) -> SubstreamProtocol<<ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundProtocol, <ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundOpenInfo>
[src]
&self
) -> SubstreamProtocol<<ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundProtocol, <ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundOpenInfo>
pub fn inject_fully_negotiated_inbound(
&mut self,
out: <<ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundOpenInfo
)
[src]
&mut self,
out: <<ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundOpenInfo
)
pub fn inject_fully_negotiated_outbound(
&mut self,
out: <<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
out: <<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo
)
pub fn inject_event(
&mut self,
event: <ToggleProtoHandler<TInner> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
event: <ToggleProtoHandler<TInner> as ProtocolsHandler>::InEvent
)
pub fn inject_address_change(&mut self, addr: &Multiaddr)
[src]
pub fn inject_dial_upgrade_error(
&mut self,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo,
err: ProtocolsHandlerUpgrErr<<<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
[src]
&mut self,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo,
err: ProtocolsHandlerUpgrErr<<<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
pub fn inject_listen_upgrade_error(
&mut self,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundOpenInfo,
err: ProtocolsHandlerUpgrErr<<<ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Error>
)
[src]
&mut self,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundOpenInfo,
err: ProtocolsHandlerUpgrErr<<<ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Error>
)
pub fn connection_keep_alive(&self) -> KeepAlive
[src]
pub fn poll(
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol, <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo, <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutEvent, <ToggleProtoHandler<TInner> as ProtocolsHandler>::Error>>
[src]
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol, <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo, <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutEvent, <ToggleProtoHandler<TInner> as ProtocolsHandler>::Error>>
impl<TProto1, TProto2> ProtocolsHandler for ProtocolsHandlerSelect<TProto1, TProto2> where
TProto1: ProtocolsHandler,
TProto2: ProtocolsHandler,
[src]
TProto1: ProtocolsHandler,
TProto2: ProtocolsHandler,
type InEvent = EitherOutput<<TProto1 as ProtocolsHandler>::InEvent, <TProto2 as ProtocolsHandler>::InEvent>
type OutEvent = EitherOutput<<TProto1 as ProtocolsHandler>::OutEvent, <TProto2 as ProtocolsHandler>::OutEvent>
type Error = EitherError<<TProto1 as ProtocolsHandler>::Error, <TProto2 as ProtocolsHandler>::Error>
type InboundProtocol = SelectUpgrade<SendWrapper<<TProto1 as ProtocolsHandler>::InboundProtocol>, SendWrapper<<TProto2 as ProtocolsHandler>::InboundProtocol>>
type OutboundProtocol = EitherUpgrade<SendWrapper<<TProto1 as ProtocolsHandler>::OutboundProtocol>, SendWrapper<<TProto2 as ProtocolsHandler>::OutboundProtocol>>
type OutboundOpenInfo = EitherOutput<<TProto1 as ProtocolsHandler>::OutboundOpenInfo, <TProto2 as ProtocolsHandler>::OutboundOpenInfo>
type InboundOpenInfo = (<TProto1 as ProtocolsHandler>::InboundOpenInfo, <TProto2 as ProtocolsHandler>::InboundOpenInfo)
pub fn listen_protocol(
&self
) -> SubstreamProtocol<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundProtocol, <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundOpenInfo>
[src]
&self
) -> SubstreamProtocol<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundProtocol, <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundOpenInfo>
pub fn inject_fully_negotiated_outbound(
&mut self,
protocol: <<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
endpoint: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: <<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
endpoint: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundOpenInfo
)
pub fn inject_fully_negotiated_inbound(
&mut self,
protocol: <<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundOpenInfo
)
[src]
&mut self,
protocol: <<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundOpenInfo
)
pub fn inject_event(
&mut self,
event: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
event: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InEvent
)
pub fn inject_address_change(&mut self, new_address: &Multiaddr)
[src]
pub fn inject_dial_upgrade_error(
&mut self,
info: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
[src]
&mut self,
info: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
pub fn inject_listen_upgrade_error(
&mut self,
<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Error>
)
[src]
&mut self,
<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Error>
)
pub fn connection_keep_alive(&self) -> KeepAlive
[src]
pub fn poll(
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundProtocol, <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundOpenInfo, <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutEvent, <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::Error>>
[src]
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundProtocol, <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundOpenInfo, <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutEvent, <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::Error>>
impl<TProtoHandler, TMap, TNewIn> ProtocolsHandler for MapInEvent<TProtoHandler, TNewIn, TMap> where
TMap: Fn(TNewIn) -> Option<<TProtoHandler as ProtocolsHandler>::InEvent> + Send + 'static,
TNewIn: Send + 'static,
TProtoHandler: ProtocolsHandler,
[src]
TMap: Fn(TNewIn) -> Option<<TProtoHandler as ProtocolsHandler>::InEvent> + Send + 'static,
TNewIn: Send + 'static,
TProtoHandler: ProtocolsHandler,
type InEvent = TNewIn
type OutEvent = <TProtoHandler as ProtocolsHandler>::OutEvent
type Error = <TProtoHandler as ProtocolsHandler>::Error
type InboundProtocol = <TProtoHandler as ProtocolsHandler>::InboundProtocol
type OutboundProtocol = <TProtoHandler as ProtocolsHandler>::OutboundProtocol
type InboundOpenInfo = <TProtoHandler as ProtocolsHandler>::InboundOpenInfo
type OutboundOpenInfo = <TProtoHandler as ProtocolsHandler>::OutboundOpenInfo
pub fn listen_protocol(
&self
) -> SubstreamProtocol<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundProtocol, <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundOpenInfo>
[src]
&self
) -> SubstreamProtocol<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundProtocol, <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundOpenInfo>
pub fn inject_fully_negotiated_inbound(
&mut self,
protocol: <<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundOpenInfo
)
[src]
&mut self,
protocol: <<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundOpenInfo
)
pub fn inject_fully_negotiated_outbound(
&mut self,
protocol: <<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: <<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundOpenInfo
)
pub fn inject_event(&mut self, event: TNewIn)
[src]
pub fn inject_address_change(&mut self, addr: &Multiaddr)
[src]
pub fn inject_dial_upgrade_error(
&mut self,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
[src]
&mut self,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
pub fn inject_listen_upgrade_error(
&mut self,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Error>
)
[src]
&mut self,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Error>
)
pub fn connection_keep_alive(&self) -> KeepAlive
[src]
pub fn poll(
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundProtocol, <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundOpenInfo, <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutEvent, <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::Error>>
[src]
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundProtocol, <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundOpenInfo, <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutEvent, <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::Error>>
impl<TProtoHandler, TMap, TNewOut> ProtocolsHandler for MapOutEvent<TProtoHandler, TMap> where
TMap: FnMut(<TProtoHandler as ProtocolsHandler>::OutEvent) -> TNewOut + Send + 'static,
TNewOut: Send + 'static,
TProtoHandler: ProtocolsHandler,
[src]
TMap: FnMut(<TProtoHandler as ProtocolsHandler>::OutEvent) -> TNewOut + Send + 'static,
TNewOut: Send + 'static,
TProtoHandler: ProtocolsHandler,
type InEvent = <TProtoHandler as ProtocolsHandler>::InEvent
type OutEvent = TNewOut
type Error = <TProtoHandler as ProtocolsHandler>::Error
type InboundProtocol = <TProtoHandler as ProtocolsHandler>::InboundProtocol
type OutboundProtocol = <TProtoHandler as ProtocolsHandler>::OutboundProtocol
type InboundOpenInfo = <TProtoHandler as ProtocolsHandler>::InboundOpenInfo
type OutboundOpenInfo = <TProtoHandler as ProtocolsHandler>::OutboundOpenInfo
pub fn listen_protocol(
&self
) -> SubstreamProtocol<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundProtocol, <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundOpenInfo>
[src]
&self
) -> SubstreamProtocol<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundProtocol, <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundOpenInfo>
pub fn inject_fully_negotiated_inbound(
&mut self,
protocol: <<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundOpenInfo
)
[src]
&mut self,
protocol: <<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Output,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundOpenInfo
)
pub fn inject_fully_negotiated_outbound(
&mut self,
protocol: <<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: <<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Output,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundOpenInfo
)
pub fn inject_event(
&mut self,
event: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
event: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InEvent
)
pub fn inject_address_change(&mut self, addr: &Multiaddr)
[src]
pub fn inject_dial_upgrade_error(
&mut self,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
[src]
&mut self,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Error>
)
pub fn inject_listen_upgrade_error(
&mut self,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Error>
)
[src]
&mut self,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Error>
)
pub fn connection_keep_alive(&self) -> KeepAlive
[src]
pub fn poll(
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundProtocol, <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundOpenInfo, <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutEvent, <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::Error>>
[src]
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundProtocol, <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundOpenInfo, <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutEvent, <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::Error>>
impl<TUserData> ProtocolsHandler for KademliaHandler<TUserData> where
TUserData: Clone + Send + 'static,
[src]
TUserData: Clone + Send + 'static,
type InEvent = KademliaHandlerIn<TUserData>
type OutEvent = KademliaHandlerEvent<TUserData>
type Error = Error
type InboundProtocol = EitherUpgrade<KademliaProtocolConfig, DeniedUpgrade>
type OutboundProtocol = KademliaProtocolConfig
type OutboundOpenInfo = (KadRequestMsg, Option<TUserData>)
type InboundOpenInfo = ()
pub fn listen_protocol(
&self
) -> SubstreamProtocol<<KademliaHandler<TUserData> as ProtocolsHandler>::InboundProtocol, <KademliaHandler<TUserData> as ProtocolsHandler>::InboundOpenInfo>
[src]
&self
) -> SubstreamProtocol<<KademliaHandler<TUserData> as ProtocolsHandler>::InboundProtocol, <KademliaHandler<TUserData> as ProtocolsHandler>::InboundOpenInfo>
pub fn inject_fully_negotiated_outbound(
&mut self,
protocol: <<KademliaHandler<TUserData> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output,
<KademliaHandler<TUserData> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: <<KademliaHandler<TUserData> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output,
<KademliaHandler<TUserData> as ProtocolsHandler>::OutboundOpenInfo
)
pub fn inject_fully_negotiated_inbound(
&mut self,
protocol: <<KademliaHandler<TUserData> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output,
<KademliaHandler<TUserData> as ProtocolsHandler>::InboundOpenInfo
)
[src]
&mut self,
protocol: <<KademliaHandler<TUserData> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output,
<KademliaHandler<TUserData> as ProtocolsHandler>::InboundOpenInfo
)
pub fn inject_event(&mut self, message: KademliaHandlerIn<TUserData>)
[src]
pub fn inject_dial_upgrade_error(
&mut self,
<KademliaHandler<TUserData> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<Error>
)
[src]
&mut self,
<KademliaHandler<TUserData> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<Error>
)
pub fn connection_keep_alive(&self) -> KeepAlive
[src]
pub fn poll(
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<KademliaHandler<TUserData> as ProtocolsHandler>::OutboundProtocol, <KademliaHandler<TUserData> as ProtocolsHandler>::OutboundOpenInfo, <KademliaHandler<TUserData> as ProtocolsHandler>::OutEvent, <KademliaHandler<TUserData> as ProtocolsHandler>::Error>>
[src]
&mut self,
cx: &mut Context<'_>
) -> Poll<ProtocolsHandlerEvent<<KademliaHandler<TUserData> as ProtocolsHandler>::OutboundProtocol, <KademliaHandler<TUserData> as ProtocolsHandler>::OutboundOpenInfo, <KademliaHandler<TUserData> as ProtocolsHandler>::OutEvent, <KademliaHandler<TUserData> as ProtocolsHandler>::Error>>