[][src]Struct libp2p::core::protocols_handler::NodeHandlerWrapper

pub struct NodeHandlerWrapper<TProtoHandler> where
    TProtoHandler: ProtocolsHandler
{ /* fields omitted */ }

Wraps around an implementation of ProtocolsHandler, and implements NodeHandler.

Trait Implementations

impl<TProtoHandler> NodeHandler for NodeHandlerWrapper<TProtoHandler> where
    TProtoHandler: ProtocolsHandler,
    <<TProtoHandler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<TProtoHandler as ProtocolsHandler>::Substream>>::Error: Debug
[src]

type InEvent = <TProtoHandler as ProtocolsHandler>::InEvent

Custom event that can be received from the outside.

type OutEvent = <TProtoHandler as ProtocolsHandler>::OutEvent

Custom event that can be produced by the handler and that will be returned by the swarm.

type Error = NodeHandlerWrapperError<<TProtoHandler as ProtocolsHandler>::Error>

Error that can happen during the processing of the node.

type Substream = <TProtoHandler as ProtocolsHandler>::Substream

The type of the substream containing the data.

type OutboundOpenInfo = (u64, <TProtoHandler as ProtocolsHandler>::OutboundOpenInfo, Duration)

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. Read more

Auto Trait Implementations

impl<TProtoHandler> Send for NodeHandlerWrapper<TProtoHandler> where
    TProtoHandler: Send,
    <<TProtoHandler as ProtocolsHandler>::InboundProtocol as InboundUpgrade<<TProtoHandler as ProtocolsHandler>::Substream>>::Future: Send,
    <<TProtoHandler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<TProtoHandler as ProtocolsHandler>::Substream>>::Future: Send,
    <TProtoHandler as ProtocolsHandler>::InboundProtocol: Send + UpgradeInfo,
    <<TProtoHandler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::Info: ProtocolName + Send,
    <<TProtoHandler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::Info: ProtocolName + Send,
    <<TProtoHandler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::InfoIter: IntoIterator,
    <<<TProtoHandler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Iterator + Send,
    <TProtoHandler as ProtocolsHandler>::OutboundOpenInfo: Send,
    <TProtoHandler as ProtocolsHandler>::OutboundProtocol: Send + UpgradeInfo,
    <TProtoHandler as ProtocolsHandler>::Substream: AsyncRead + AsyncWrite + Send

impl<TProtoHandler> Sync for NodeHandlerWrapper<TProtoHandler> where
    TProtoHandler: Sync,
    <<TProtoHandler as ProtocolsHandler>::InboundProtocol as InboundUpgrade<<TProtoHandler as ProtocolsHandler>::Substream>>::Future: Sync,
    <<TProtoHandler as ProtocolsHandler>::OutboundProtocol as OutboundUpgrade<<TProtoHandler as ProtocolsHandler>::Substream>>::Future: Sync,
    <TProtoHandler as ProtocolsHandler>::InboundProtocol: Sync + UpgradeInfo,
    <<TProtoHandler as ProtocolsHandler>::InboundProtocol as UpgradeInfo>::Info: ProtocolName + Sync,
    <<TProtoHandler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::Info: ProtocolName + Sync,
    <<TProtoHandler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::InfoIter: IntoIterator,
    <<<TProtoHandler as ProtocolsHandler>::OutboundProtocol as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter: Iterator + Sync,
    <TProtoHandler as ProtocolsHandler>::OutboundOpenInfo: Sync,
    <TProtoHandler as ProtocolsHandler>::OutboundProtocol: Sync + UpgradeInfo,
    <TProtoHandler as ProtocolsHandler>::Substream: AsyncRead + AsyncWrite + Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, TConnInfo> IntoNodeHandler<TConnInfo> for T where
    T: NodeHandler
[src]

type Handler = T

The node handler.

impl<T> Erased for T

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.