Trait libp2p::swarm::IntoProtocolsHandler[][src]

pub trait IntoProtocolsHandler: 'static + Send {
    type Handler: ProtocolsHandler;
    pub fn into_handler(
        self,
        remote_peer_id: &PeerId,
        connected_point: &ConnectedPoint
    ) -> Self::Handler;
pub fn inbound_protocol(
        &self
    ) -> <Self::Handler as ProtocolsHandler>::InboundProtocol; pub fn select<TProto2>(
        self,
        other: TProto2
    ) -> IntoProtocolsHandlerSelect<Self, TProto2> { ... }
pub fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self> { ... } }

Prototype for a ProtocolsHandler.

Associated Types

type Handler: ProtocolsHandler[src]

The protocols handler.

Loading content...

Required methods

pub fn into_handler(
    self,
    remote_peer_id: &PeerId,
    connected_point: &ConnectedPoint
) -> Self::Handler
[src]

Builds the protocols handler.

The PeerId is the id of the node the handler is going to handle.

pub fn inbound_protocol(
    &self
) -> <Self::Handler as ProtocolsHandler>::InboundProtocol
[src]

Return the handler’s inbound protocol.

Loading content...

Provided methods

pub fn select<TProto2>(
    self,
    other: TProto2
) -> IntoProtocolsHandlerSelect<Self, TProto2>
[src]

Builds an implementation of IntoProtocolsHandler that handles both this protocol and the other one together.

pub fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self>[src]

Creates a builder that will allow creating a NodeHandler that handles this protocol exclusively.

Loading content...

Implementors

impl<K, H> IntoProtocolsHandler for IntoMultiHandler<K, H> where
    K: Clone + Eq + Hash + Send + 'static,
    H: IntoProtocolsHandler
[src]

impl<T> IntoProtocolsHandler for T where
    T: ProtocolsHandler
[src]

impl<TInner> IntoProtocolsHandler for ToggleIntoProtoHandler<TInner> where
    TInner: IntoProtocolsHandler
[src]

type Handler = ToggleProtoHandler<<TInner as IntoProtocolsHandler>::Handler>

impl<TProto1, TProto2> IntoProtocolsHandler for IntoProtocolsHandlerSelect<TProto1, TProto2> where
    TProto1: IntoProtocolsHandler,
    TProto2: IntoProtocolsHandler
[src]

type Handler = ProtocolsHandlerSelect<<TProto1 as IntoProtocolsHandler>::Handler, <TProto2 as IntoProtocolsHandler>::Handler>

Loading content...