pub struct NodeHandlerWrapper<TProtoHandler>where
TProtoHandler: ProtocolsHandler,{ /* private fields */ }
Expand description
Wraps around an implementation of ProtocolsHandler
, and implements NodeHandler
.
Trait Implementations§
Source§impl<TProtoHandler> ConnectionHandler for NodeHandlerWrapper<TProtoHandler>where
TProtoHandler: ProtocolsHandler,
impl<TProtoHandler> ConnectionHandler for NodeHandlerWrapper<TProtoHandler>where
TProtoHandler: ProtocolsHandler,
Source§type InEvent = <TProtoHandler as ProtocolsHandler>::InEvent
type InEvent = <TProtoHandler as ProtocolsHandler>::InEvent
The inbound type of events used to notify the handler through the
Network
. Read moreSource§type OutEvent = <TProtoHandler as ProtocolsHandler>::OutEvent
type OutEvent = <TProtoHandler as ProtocolsHandler>::OutEvent
The outbound type of events that the handler emits to the
Network
through ConnectionHandler::poll
. Read moreSource§type Error = NodeHandlerWrapperError<<TProtoHandler as ProtocolsHandler>::Error>
type Error = NodeHandlerWrapperError<<TProtoHandler as ProtocolsHandler>::Error>
The type of errors that the handler can produce when polled by the
Network
.Source§type Substream = SubstreamRef<Arc<StreamMuxerBox>>
type Substream = SubstreamRef<Arc<StreamMuxerBox>>
The type of the substream containing the data.
Source§type OutboundOpenInfo = (u64, <TProtoHandler as ProtocolsHandler>::OutboundOpenInfo, Duration)
type OutboundOpenInfo = (u64, <TProtoHandler as ProtocolsHandler>::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
.Source§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
Source§fn inject_event(&mut self, event: Self::InEvent)
fn inject_event(&mut self, event: Self::InEvent)
Notifies the handler of an event.
Source§fn inject_address_change(&mut self, new_address: &Multiaddr)
fn inject_address_change(&mut self, new_address: &Multiaddr)
Notifies the handler of a change in the address of the remote.
Auto Trait Implementations§
impl<TProtoHandler> !Freeze for NodeHandlerWrapper<TProtoHandler>
impl<TProtoHandler> !RefUnwindSafe for NodeHandlerWrapper<TProtoHandler>
impl<TProtoHandler> Send for NodeHandlerWrapper<TProtoHandler>
impl<TProtoHandler> Sync for NodeHandlerWrapper<TProtoHandler>where
TProtoHandler: Sync,
<TProtoHandler as ProtocolsHandler>::InboundOpenInfo: Sync,
<TProtoHandler as ProtocolsHandler>::OutboundOpenInfo: Sync,
<TProtoHandler as ProtocolsHandler>::InboundProtocol: Sync,
<TProtoHandler as ProtocolsHandler>::OutboundProtocol: Sync,
<<TProtoHandler as ProtocolsHandler>::InboundProtocol as InboundUpgradeSend>::Future: Sync,
<<TProtoHandler as ProtocolsHandler>::OutboundProtocol as UpgradeInfoSend>::InfoIter: Sync,
<<TProtoHandler as ProtocolsHandler>::OutboundProtocol as OutboundUpgradeSend>::Future: Sync,
<<TProtoHandler as ProtocolsHandler>::InboundProtocol as UpgradeInfoSend>::Info: Sync,
<<TProtoHandler as ProtocolsHandler>::OutboundProtocol as UpgradeInfoSend>::Info: Sync,
impl<TProtoHandler> Unpin for NodeHandlerWrapper<TProtoHandler>
impl<TProtoHandler> !UnwindSafe for NodeHandlerWrapper<TProtoHandler>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoConnectionHandler for Twhere
T: ConnectionHandler,
impl<T> IntoConnectionHandler for Twhere
T: ConnectionHandler,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more