[−][src]Trait libp2p::core::protocols_handler::ProtocolsHandler
Handler for a set of protocols for a specific connection with a remote.
This trait should be implemented on a struct that holds the state for a specific protocol behaviour with a specific remote.
Handling a protocol
Communication with a remote over a set of protocols opened in two different ways:
- Dialing, which is a voluntary process. In order to do so, make
poll()
return anOutboundSubstreamRequest
variant containing the connection upgrade to use to start using a protocol. - Listening, which is used to determine which protocols are supported when the remote wants
to open a substream. The
listen_protocol()
method should return the upgrades supported when listening.
The upgrade when dialing and the upgrade when listening have to be of the same type, but you
are free to return for example an OrUpgrade
enum, or an enum of your own, containing the
upgrade you want depending on the situation.
Shutting down
Implementors of this trait should keep in mind that the connection can be closed at any time.
When a connection is closed (either by us or by the remote) shutdown()
is called and the
handler continues to be processed until it produces ProtocolsHandlerEvent::Shutdown
. Only
then the handler is destroyed.
This makes it possible for the handler to finish delivering events even after knowing that it is shutting down.
Implementors of this trait should keep in mind that when shutdown()
is called, the connection
might already be closed or unresponsive. They should therefore not rely on being able to
deliver messages.
Associated Types
type InEvent
Custom event that can be received from the outside.
type OutEvent
Custom event that can be produced by the handler and that will be returned to the outside.
type Error: Error
Error that can happen when polling.
type Substream: AsyncRead + AsyncWrite
The type of the substream that contains the raw data.
type InboundProtocol: InboundUpgrade<Self::Substream>
The upgrade for the protocol or protocols handled by this handler.
type OutboundProtocol: OutboundUpgrade<Self::Substream>
The upgrade for the protocol or protocols handled by this handler.
type OutboundOpenInfo
Information about a substream. Can be sent to the handler through a NodeHandlerEndpoint
,
and will be passed back in inject_substream
or inject_outbound_closed
.
Required methods
fn listen_protocol(&self) -> Self::InboundProtocol
Produces a ConnectionUpgrade
for the protocol or protocols to accept when listening.
Note: You should always accept all the protocols you support, even if in a specific context you wouldn't accept one in particular (eg. only allow one substream at a time for a given protocol). The reason is that remotes are allowed to put the list of supported protocols in a cache in order to avoid spurious queries.
fn inject_fully_negotiated_inbound(
&mut self,
protocol: <Self::InboundProtocol as InboundUpgrade<Self::Substream>>::Output
)
&mut self,
protocol: <Self::InboundProtocol as InboundUpgrade<Self::Substream>>::Output
)
Injects a fully-negotiated substream in the handler.
This method is called when a substream has been successfully opened and negotiated.
fn inject_fully_negotiated_outbound(
&mut self,
protocol: <Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Output,
info: Self::OutboundOpenInfo
)
&mut self,
protocol: <Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Output,
info: Self::OutboundOpenInfo
)
fn inject_event(&mut self, event: Self::InEvent)
Injects an event coming from the outside in the handler.
fn inject_dial_upgrade_error(
&mut self,
info: Self::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Error>
)
&mut self,
info: Self::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<Self::OutboundProtocol as OutboundUpgrade<Self::Substream>>::Error>
)
Indicates to the handler that upgrading a substream to the given protocol has failed.
fn connection_keep_alive(&self) -> KeepAlive
Returns until when the connection should be kept alive.
If returns Until
, that indicates that this connection may be closed and this handler
destroyed after the returned Instant
has elapsed if they think that they will no longer
need the connection in the future. Returning Forever
is equivalent to "infinite".
Returning Now
is equivalent to Until(Instant::now())
.
On the other hand, the return value is only an indication and doesn't mean that the user will not close the connection.
When multiple ProtocolsHandler
are combined together, the largest KeepAlive
should be
used.
The result of this method should be checked every time poll()
is invoked.
fn poll(
&mut self
) -> Result<Async<ProtocolsHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, Self::OutEvent>>, Self::Error>
&mut self
) -> Result<Async<ProtocolsHandlerEvent<Self::OutboundProtocol, Self::OutboundOpenInfo, Self::OutEvent>>, Self::Error>
Should behave like Stream::poll()
.
Returning an error will close the connection to the remote.
Provided methods
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
Adds a closure that turns the input event into something else.
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
TMap: FnMut(Self::OutEvent) -> TNewOut,
Adds a closure that turns the output event into something else.
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
Builds an implementation of ProtocolsHandler
that handles both this protocol and the
other one together.
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
Creates a builder that will allow creating a NodeHandler
that handles this protocol
exclusively.
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
Use into_node_handler_builder instead
Builds an implementation of NodeHandler
that handles this protocol exclusively.
Note: This is a shortcut for
self.into_node_handler_builder().build()
.
Implementors
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 Substream = <TInner as ProtocolsHandler>::Substream
type InboundProtocol = EitherUpgrade<<TInner as ProtocolsHandler>::InboundProtocol, DeniedUpgrade>
type OutboundProtocol = <TInner as ProtocolsHandler>::OutboundProtocol
type OutboundOpenInfo = <TInner as ProtocolsHandler>::OutboundOpenInfo
fn listen_protocol(
&self
) -> <ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundProtocol
[src]
&self
) -> <ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundProtocol
fn inject_fully_negotiated_inbound(
&mut self,
out: <<ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<<ToggleProtoHandler<TInner> as ProtocolsHandler>::Substream>>::Output
)
[src]
&mut self,
out: <<ToggleProtoHandler<TInner> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<<ToggleProtoHandler<TInner> as ProtocolsHandler>::Substream>>::Output
)
fn inject_fully_negotiated_outbound(
&mut self,
out: <<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<ToggleProtoHandler<TInner> as ProtocolsHandler>::Substream>>::Output,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
out: <<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<ToggleProtoHandler<TInner> as ProtocolsHandler>::Substream>>::Output,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo
)
fn inject_event(
&mut self,
event: <ToggleProtoHandler<TInner> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
event: <ToggleProtoHandler<TInner> as ProtocolsHandler>::InEvent
)
fn inject_dial_upgrade_error(
&mut self,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo,
err: ProtocolsHandlerUpgrErr<<<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<ToggleProtoHandler<TInner> as ProtocolsHandler>::Substream>>::Error>
)
[src]
&mut self,
info: <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo,
err: ProtocolsHandlerUpgrErr<<<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<ToggleProtoHandler<TInner> as ProtocolsHandler>::Substream>>::Error>
)
fn connection_keep_alive(&self) -> KeepAlive
[src]
fn poll(
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol, <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo, <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutEvent>>, <ToggleProtoHandler<TInner> as ProtocolsHandler>::Error>
[src]
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundProtocol, <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutboundOpenInfo, <ToggleProtoHandler<TInner> as ProtocolsHandler>::OutEvent>>, <ToggleProtoHandler<TInner> as ProtocolsHandler>::Error>
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
[src]
Use into_node_handler_builder instead
impl<TProtoHandler, TMap, TNewIn> ProtocolsHandler for MapInEvent<TProtoHandler, TNewIn, TMap> where
TMap: Fn(TNewIn) -> Option<<TProtoHandler as ProtocolsHandler>::InEvent>,
TProtoHandler: ProtocolsHandler,
[src]
TMap: Fn(TNewIn) -> Option<<TProtoHandler as ProtocolsHandler>::InEvent>,
TProtoHandler: ProtocolsHandler,
type InEvent = TNewIn
type OutEvent = <TProtoHandler as ProtocolsHandler>::OutEvent
type Error = <TProtoHandler as ProtocolsHandler>::Error
type Substream = <TProtoHandler as ProtocolsHandler>::Substream
type InboundProtocol = <TProtoHandler as ProtocolsHandler>::InboundProtocol
type OutboundProtocol = <TProtoHandler as ProtocolsHandler>::OutboundProtocol
type OutboundOpenInfo = <TProtoHandler as ProtocolsHandler>::OutboundOpenInfo
fn listen_protocol(
&self
) -> <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundProtocol
[src]
&self
) -> <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundProtocol
fn inject_fully_negotiated_inbound(
&mut self,
protocol: <<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::Substream>>::Output
)
[src]
&mut self,
protocol: <<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::Substream>>::Output
)
fn inject_fully_negotiated_outbound(
&mut self,
protocol: <<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::Substream>>::Output,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: <<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::Substream>>::Output,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundOpenInfo
)
fn inject_event(&mut self, event: TNewIn)
[src]
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 OutboundUpgrade<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::Substream>>::Error>
)
[src]
&mut self,
info: <MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<MapInEvent<TProtoHandler, TNewIn, TMap> as ProtocolsHandler>::Substream>>::Error>
)
fn connection_keep_alive(&self) -> KeepAlive
[src]
fn poll(
&mut self
) -> Result<Async<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
) -> Result<Async<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>
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
[src]
Use into_node_handler_builder instead
impl<TProtoHandler, TMap, TNewOut> ProtocolsHandler for MapOutEvent<TProtoHandler, TMap> where
TMap: FnMut(<TProtoHandler as ProtocolsHandler>::OutEvent) -> TNewOut,
TProtoHandler: ProtocolsHandler,
[src]
TMap: FnMut(<TProtoHandler as ProtocolsHandler>::OutEvent) -> TNewOut,
TProtoHandler: ProtocolsHandler,
type InEvent = <TProtoHandler as ProtocolsHandler>::InEvent
type OutEvent = TNewOut
type Error = <TProtoHandler as ProtocolsHandler>::Error
type Substream = <TProtoHandler as ProtocolsHandler>::Substream
type InboundProtocol = <TProtoHandler as ProtocolsHandler>::InboundProtocol
type OutboundProtocol = <TProtoHandler as ProtocolsHandler>::OutboundProtocol
type OutboundOpenInfo = <TProtoHandler as ProtocolsHandler>::OutboundOpenInfo
fn listen_protocol(
&self
) -> <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundProtocol
[src]
&self
) -> <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundProtocol
fn inject_fully_negotiated_inbound(
&mut self,
protocol: <<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::Substream>>::Output
)
[src]
&mut self,
protocol: <<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::Substream>>::Output
)
fn inject_fully_negotiated_outbound(
&mut self,
protocol: <<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::Substream>>::Output,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: <<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::Substream>>::Output,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundOpenInfo
)
fn inject_event(
&mut self,
event: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
event: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::InEvent
)
fn inject_dial_upgrade_error(
&mut self,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::Substream>>::Error>
)
[src]
&mut self,
info: <MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<MapOutEvent<TProtoHandler, TMap> as ProtocolsHandler>::Substream>>::Error>
)
fn connection_keep_alive(&self) -> KeepAlive
[src]
fn poll(
&mut self
) -> Result<Async<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
) -> Result<Async<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>
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
[src]
Use into_node_handler_builder instead
impl<TSubstream> ProtocolsHandler for DummyProtocolsHandler<TSubstream> where
TSubstream: AsyncRead + AsyncWrite,
[src]
TSubstream: AsyncRead + AsyncWrite,
type InEvent = Void
type OutEvent = Void
type Error = Void
type Substream = TSubstream
type InboundProtocol = DeniedUpgrade
type OutboundProtocol = DeniedUpgrade
type OutboundOpenInfo = Void
fn listen_protocol(
&self
) -> <DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::InboundProtocol
[src]
&self
) -> <DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::InboundProtocol
fn inject_fully_negotiated_inbound(
&mut self,
<<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<TSubstream>>::Output
)
[src]
&mut self,
<<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<TSubstream>>::Output
)
fn inject_fully_negotiated_outbound(
&mut self,
<<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<TSubstream>>::Output,
<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
<<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<TSubstream>>::Output,
<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo
)
fn inject_event(
&mut self,
<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::InEvent
)
fn inject_dial_upgrade_error(
&mut self,
<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo,
ProtocolsHandlerUpgrErr<<<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::Substream>>::Error>
)
[src]
&mut self,
<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo,
ProtocolsHandlerUpgrErr<<<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::Substream>>::Error>
)
fn connection_keep_alive(&self) -> KeepAlive
[src]
fn poll(
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol, <DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo, <DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutEvent>>, Void>
[src]
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol, <DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo, <DummyProtocolsHandler<TSubstream> as ProtocolsHandler>::OutEvent>>, Void>
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
[src]
Use into_node_handler_builder instead
impl<TSubstream> ProtocolsHandler for IdentifyListenHandler<TSubstream> where
TSubstream: AsyncRead + AsyncWrite,
[src]
TSubstream: AsyncRead + AsyncWrite,
type InEvent = Void
type OutEvent = IdentifySender<Negotiated<TSubstream>>
type Error = Void
type Substream = TSubstream
type InboundProtocol = IdentifyProtocolConfig
type OutboundProtocol = DeniedUpgrade
type OutboundOpenInfo = ()
fn listen_protocol(
&self
) -> <IdentifyListenHandler<TSubstream> as ProtocolsHandler>::InboundProtocol
[src]
&self
) -> <IdentifyListenHandler<TSubstream> as ProtocolsHandler>::InboundProtocol
fn inject_fully_negotiated_inbound(
&mut self,
protocol: <<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<TSubstream>>::Output
)
[src]
&mut self,
protocol: <<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<TSubstream>>::Output
)
fn inject_fully_negotiated_outbound(
&mut self,
protocol: Void,
<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: Void,
<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo
)
fn inject_event(
&mut self,
<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::InEvent
)
fn inject_dial_upgrade_error(
&mut self,
<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo,
ProtocolsHandlerUpgrErr<<<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::Substream>>::Error>
)
[src]
&mut self,
<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo,
ProtocolsHandlerUpgrErr<<<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::Substream>>::Error>
)
fn connection_keep_alive(&self) -> KeepAlive
[src]
fn poll(
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol, <IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo, <IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutEvent>>, <IdentifyListenHandler<TSubstream> as ProtocolsHandler>::Error>
[src]
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol, <IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo, <IdentifyListenHandler<TSubstream> as ProtocolsHandler>::OutEvent>>, <IdentifyListenHandler<TSubstream> as ProtocolsHandler>::Error>
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
[src]
Use into_node_handler_builder instead
impl<TSubstream> ProtocolsHandler for PeriodicIdHandler<TSubstream> where
TSubstream: AsyncRead + AsyncWrite,
[src]
TSubstream: AsyncRead + AsyncWrite,
type InEvent = Void
type OutEvent = PeriodicIdHandlerEvent
type Error = Error
type Substream = TSubstream
type InboundProtocol = DeniedUpgrade
type OutboundProtocol = IdentifyProtocolConfig
type OutboundOpenInfo = ()
fn listen_protocol(
&self
) -> <PeriodicIdHandler<TSubstream> as ProtocolsHandler>::InboundProtocol
[src]
&self
) -> <PeriodicIdHandler<TSubstream> as ProtocolsHandler>::InboundProtocol
fn inject_fully_negotiated_inbound(&mut self, protocol: Void)
[src]
fn inject_fully_negotiated_outbound(
&mut self,
protocol: <<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<TSubstream>>::Output,
_info: <PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: <<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<TSubstream>>::Output,
_info: <PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo
)
fn inject_event(
&mut self,
<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::InEvent
)
fn inject_dial_upgrade_error(
&mut self,
<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo,
err: ProtocolsHandlerUpgrErr<<<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::Substream>>::Error>
)
[src]
&mut self,
<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo,
err: ProtocolsHandlerUpgrErr<<<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::Substream>>::Error>
)
fn connection_keep_alive(&self) -> KeepAlive
[src]
fn poll(
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol, <PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo, PeriodicIdHandlerEvent>>, <PeriodicIdHandler<TSubstream> as ProtocolsHandler>::Error>
[src]
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol, <PeriodicIdHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo, PeriodicIdHandlerEvent>>, <PeriodicIdHandler<TSubstream> as ProtocolsHandler>::Error>
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
[src]
Use into_node_handler_builder instead
impl<TSubstream> ProtocolsHandler for PingHandler<TSubstream> where
TSubstream: AsyncRead + AsyncWrite,
[src]
TSubstream: AsyncRead + AsyncWrite,
type InEvent = Void
type OutEvent = PingOutput
type Error = ProtocolsHandlerUpgrErr<Error>
type Substream = TSubstream
type InboundProtocol = Ping
type OutboundProtocol = Ping
type OutboundOpenInfo = ()
fn listen_protocol(
&self
) -> <PingHandler<TSubstream> as ProtocolsHandler>::InboundProtocol
[src]
&self
) -> <PingHandler<TSubstream> as ProtocolsHandler>::InboundProtocol
fn inject_fully_negotiated_inbound(&mut self, protocol: ())
[src]
fn inject_fully_negotiated_outbound(
&mut self,
duration: Duration,
info: <PingHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
duration: Duration,
info: <PingHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo
)
fn inject_event(&mut self, event: Void)
[src]
fn inject_dial_upgrade_error(
&mut self,
info: <PingHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<Error>
)
[src]
&mut self,
info: <PingHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<Error>
)
fn connection_keep_alive(&self) -> KeepAlive
[src]
fn poll(
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<PingHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol, <PingHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo, <PingHandler<TSubstream> as ProtocolsHandler>::OutEvent>>, <PingHandler<TSubstream> as ProtocolsHandler>::Error>
[src]
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<PingHandler<TSubstream> as ProtocolsHandler>::OutboundProtocol, <PingHandler<TSubstream> as ProtocolsHandler>::OutboundOpenInfo, <PingHandler<TSubstream> as ProtocolsHandler>::OutEvent>>, <PingHandler<TSubstream> as ProtocolsHandler>::Error>
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
[src]
Use into_node_handler_builder instead
impl<TSubstream, TInProto, TOutProto, TOutEvent> ProtocolsHandler for OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> where
TInProto: InboundUpgrade<TSubstream> + Clone,
TOutProto: OutboundUpgrade<TSubstream>,
TSubstream: AsyncRead + AsyncWrite,
<TInProto as InboundUpgrade<TSubstream>>::Output: Into<TOutEvent>,
<TOutProto as OutboundUpgrade<TSubstream>>::Output: Into<TOutEvent>,
<TOutProto as OutboundUpgrade<TSubstream>>::Error: Error,
<TOutProto as OutboundUpgrade<TSubstream>>::Error: 'static,
[src]
TInProto: InboundUpgrade<TSubstream> + Clone,
TOutProto: OutboundUpgrade<TSubstream>,
TSubstream: AsyncRead + AsyncWrite,
<TInProto as InboundUpgrade<TSubstream>>::Output: Into<TOutEvent>,
<TOutProto as OutboundUpgrade<TSubstream>>::Output: Into<TOutEvent>,
<TOutProto as OutboundUpgrade<TSubstream>>::Error: Error,
<TOutProto as OutboundUpgrade<TSubstream>>::Error: 'static,
type InEvent = TOutProto
type OutEvent = TOutEvent
type Error = ProtocolsHandlerUpgrErr<<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::Substream>>::Error>
type Substream = TSubstream
type InboundProtocol = TInProto
type OutboundProtocol = TOutProto
type OutboundOpenInfo = ()
fn listen_protocol(
&self
) -> <OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::InboundProtocol
[src]
&self
) -> <OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::InboundProtocol
fn inject_fully_negotiated_inbound(
&mut self,
out: <<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::Substream>>::Output
)
[src]
&mut self,
out: <<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::Substream>>::Output
)
fn inject_fully_negotiated_outbound(
&mut self,
out: <<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::Substream>>::Output,
<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
out: <<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::Substream>>::Output,
<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundOpenInfo
)
fn inject_event(
&mut self,
event: <OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
event: <OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::InEvent
)
fn inject_dial_upgrade_error(
&mut self,
<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::Substream>>::Error>
)
[src]
&mut self,
<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::Substream>>::Error>
)
fn connection_keep_alive(&self) -> KeepAlive
[src]
fn poll(
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundProtocol, <OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundOpenInfo, <OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutEvent>>, <OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::Error>
[src]
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundProtocol, <OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutboundOpenInfo, <OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::OutEvent>>, <OneShotHandler<TSubstream, TInProto, TOutProto, TOutEvent> as ProtocolsHandler>::Error>
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
[src]
Use into_node_handler_builder instead
impl<TSubstream, TProto1, TProto2> ProtocolsHandler for ProtocolsHandlerSelect<TProto1, TProto2> where
TProto1: ProtocolsHandler<Substream = TSubstream>,
TProto2: ProtocolsHandler<Substream = TSubstream>,
TSubstream: AsyncRead + AsyncWrite,
<TProto1 as ProtocolsHandler>::InboundProtocol: InboundUpgrade<TSubstream>,
<TProto2 as ProtocolsHandler>::InboundProtocol: InboundUpgrade<TSubstream>,
<TProto1 as ProtocolsHandler>::OutboundProtocol: OutboundUpgrade<TSubstream>,
<TProto2 as ProtocolsHandler>::OutboundProtocol: OutboundUpgrade<TSubstream>,
[src]
TProto1: ProtocolsHandler<Substream = TSubstream>,
TProto2: ProtocolsHandler<Substream = TSubstream>,
TSubstream: AsyncRead + AsyncWrite,
<TProto1 as ProtocolsHandler>::InboundProtocol: InboundUpgrade<TSubstream>,
<TProto2 as ProtocolsHandler>::InboundProtocol: InboundUpgrade<TSubstream>,
<TProto1 as ProtocolsHandler>::OutboundProtocol: OutboundUpgrade<TSubstream>,
<TProto2 as ProtocolsHandler>::OutboundProtocol: OutboundUpgrade<TSubstream>,
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 Substream = TSubstream
type InboundProtocol = SelectUpgrade<<TProto1 as ProtocolsHandler>::InboundProtocol, <TProto2 as ProtocolsHandler>::InboundProtocol>
type OutboundProtocol = EitherUpgrade<<TProto1 as ProtocolsHandler>::OutboundProtocol, <TProto2 as ProtocolsHandler>::OutboundProtocol>
type OutboundOpenInfo = EitherOutput<<TProto1 as ProtocolsHandler>::OutboundOpenInfo, <TProto2 as ProtocolsHandler>::OutboundOpenInfo>
fn listen_protocol(
&self
) -> <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundProtocol
[src]
&self
) -> <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundProtocol
fn inject_fully_negotiated_outbound(
&mut self,
protocol: <<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<TSubstream>>::Output,
endpoint: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: <<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<TSubstream>>::Output,
endpoint: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundOpenInfo
)
fn inject_fully_negotiated_inbound(
&mut self,
protocol: <<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<TSubstream>>::Output
)
[src]
&mut self,
protocol: <<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<TSubstream>>::Output
)
fn inject_event(
&mut self,
event: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InEvent
)
[src]
&mut self,
event: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::InEvent
)
fn inject_dial_upgrade_error(
&mut self,
info: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::Substream>>::Error>
)
[src]
&mut self,
info: <ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<ProtocolsHandlerSelect<TProto1, TProto2> as ProtocolsHandler>::Substream>>::Error>
)
fn connection_keep_alive(&self) -> KeepAlive
[src]
fn poll(
&mut self
) -> Result<Async<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
) -> Result<Async<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>
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
[src]
Use into_node_handler_builder instead
impl<TSubstream, TUserData> ProtocolsHandler for KademliaHandler<TSubstream, TUserData> where
TSubstream: AsyncRead + AsyncWrite,
TUserData: Clone,
[src]
TSubstream: AsyncRead + AsyncWrite,
TUserData: Clone,
type InEvent = KademliaHandlerIn<TUserData>
type OutEvent = KademliaHandlerEvent<TUserData>
type Error = Error
type Substream = TSubstream
type InboundProtocol = EitherUpgrade<KademliaProtocolConfig, DeniedUpgrade>
type OutboundProtocol = KademliaProtocolConfig
type OutboundOpenInfo = (KadRequestMsg, Option<TUserData>)
fn listen_protocol(
&self
) -> <KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::InboundProtocol
[src]
&self
) -> <KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::InboundProtocol
fn inject_fully_negotiated_outbound(
&mut self,
protocol: <<KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<TSubstream>>::Output,
<KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutboundOpenInfo
)
[src]
&mut self,
protocol: <<KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<TSubstream>>::Output,
<KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutboundOpenInfo
)
fn inject_fully_negotiated_inbound(
&mut self,
protocol: <<KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<TSubstream>>::Output
)
[src]
&mut self,
protocol: <<KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::InboundProtocol as InboundUpgrade<TSubstream>>::Output
)
fn inject_event(&mut self, message: KademliaHandlerIn<TUserData>)
[src]
fn inject_dial_upgrade_error(
&mut self,
<KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<Error>
)
[src]
&mut self,
<KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutboundOpenInfo,
error: ProtocolsHandlerUpgrErr<Error>
)
fn connection_keep_alive(&self) -> KeepAlive
[src]
fn poll(
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutboundProtocol, <KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutboundOpenInfo, <KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutEvent>>, Error>
[src]
&mut self
) -> Result<Async<ProtocolsHandlerEvent<<KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutboundProtocol, <KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutboundOpenInfo, <KademliaHandler<TSubstream, TUserData> as ProtocolsHandler>::OutEvent>>, Error>
fn map_in_event<TNewIn, TMap>(self, map: TMap) -> MapInEvent<Self, TNewIn, TMap> where
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
[src]
TMap: Fn(&TNewIn) -> Option<&Self::InEvent>,
fn map_out_event<TMap, TNewOut>(self, map: TMap) -> MapOutEvent<Self, TMap> where
TMap: FnMut(Self::OutEvent) -> TNewOut,
[src]
TMap: FnMut(Self::OutEvent) -> TNewOut,
fn select<TProto2>(
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
[src]
self,
other: TProto2
) -> ProtocolsHandlerSelect<Self, TProto2>
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>
[src]
fn into_node_handler(self) -> NodeHandlerWrapper<Self>
[src]
Use into_node_handler_builder instead