Struct libp2p_swarm::protocols_handler::multi::MultiHandler[][src]

pub struct MultiHandler<K, H> { /* fields omitted */ }

A ProtocolsHandler for multiple ProtocolsHandlers of the same type.

Implementations

impl<K, H> MultiHandler<K, H> where
    K: Hash + Eq,
    H: ProtocolsHandler
[src]

pub fn try_from_iter<I>(iter: I) -> Result<Self, DuplicateProtonameError> where
    I: IntoIterator<Item = (K, H)>, 
[src]

Create and populate a MultiHandler from the given handler iterator.

It is an error for any two protocols handlers to share the same protocol name.

Note: All handlers should use the same [upgrade::Version] for the inbound and outbound SubstreamProtocols.

Trait Implementations

impl<K: Clone, H: Clone> Clone for MultiHandler<K, H>[src]

impl<K, H> Debug for MultiHandler<K, H> where
    K: Debug + Eq + Hash,
    H: Debug
[src]

impl<K, H> ProtocolsHandler for MultiHandler<K, H> where
    K: Clone + Hash + Eq + Send + 'static,
    H: ProtocolsHandler,
    H::InboundProtocol: InboundUpgradeSend,
    H::OutboundProtocol: OutboundUpgradeSend
[src]

type InEvent = (K, <H as ProtocolsHandler>::InEvent)

Custom event that can be received from the outside.

type OutEvent = (K, <H as ProtocolsHandler>::OutEvent)

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

type Error = <H as ProtocolsHandler>::Error

The type of errors returned by ProtocolsHandler::poll.

type InboundProtocol = Upgrade<K, <H as ProtocolsHandler>::InboundProtocol>

The inbound upgrade for the protocol(s) used by the handler.

type OutboundProtocol = <H as ProtocolsHandler>::OutboundProtocol

The outbound upgrade for the protocol(s) used by the handler.

type InboundOpenInfo = Info<K, <H as ProtocolsHandler>::InboundOpenInfo>

The type of additional information returned from listen_protocol.

type OutboundOpenInfo = (K, <H as ProtocolsHandler>::OutboundOpenInfo)

The type of additional information passed to an OutboundSubstreamRequest.

Auto Trait Implementations

impl<K, H> RefUnwindSafe for MultiHandler<K, H> where
    H: RefUnwindSafe,
    K: RefUnwindSafe
[src]

impl<K, H> Send for MultiHandler<K, H> where
    H: Send,
    K: Send
[src]

impl<K, H> Sync for MultiHandler<K, H> where
    H: Sync,
    K: Sync
[src]

impl<K, H> Unpin for MultiHandler<K, H> where
    H: Unpin,
    K: Unpin
[src]

impl<K, H> UnwindSafe for MultiHandler<K, H> where
    H: UnwindSafe,
    K: UnwindSafe
[src]

Blanket Implementations

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

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

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

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

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

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

type Handler = T

The protocols handler.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>,