Struct libp2p_swarm::handler::multi::IntoMultiHandler
source · pub struct IntoMultiHandler<K, H> { /* private fields */ }
Expand description
A IntoConnectionHandler
for multiple other IntoConnectionHandler
s.
Implementations§
source§impl<K, H> IntoMultiHandler<K, H>where
K: Hash + Eq,
H: IntoConnectionHandler,
impl<K, H> IntoMultiHandler<K, H>where
K: Hash + Eq,
H: IntoConnectionHandler,
sourcepub fn try_from_iter<I>(iter: I) -> Result<Self, DuplicateProtonameError>where
I: IntoIterator<Item = (K, H)>,
pub fn try_from_iter<I>(iter: I) -> Result<Self, DuplicateProtonameError>where
I: IntoIterator<Item = (K, H)>,
Create and populate an IntoMultiHandler
from the given iterator.
It is an error for any two protocols handlers to share the same protocol name.
Trait Implementations§
source§impl<K: Clone, H: Clone> Clone for IntoMultiHandler<K, H>
impl<K: Clone, H: Clone> Clone for IntoMultiHandler<K, H>
source§fn clone(&self) -> IntoMultiHandler<K, H>
fn clone(&self) -> IntoMultiHandler<K, H>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<K, H> IntoConnectionHandler for IntoMultiHandler<K, H>where
K: Debug + Clone + Eq + Hash + Send + 'static,
H: IntoConnectionHandler,
impl<K, H> IntoConnectionHandler for IntoMultiHandler<K, H>where
K: Debug + Clone + Eq + Hash + Send + 'static,
H: IntoConnectionHandler,
§type Handler = MultiHandler<K, <H as IntoConnectionHandler>::Handler>
type Handler = MultiHandler<K, <H as IntoConnectionHandler>::Handler>
The protocols handler.
source§fn into_handler(self, p: &PeerId, c: &ConnectedPoint) -> Self::Handler
fn into_handler(self, p: &PeerId, c: &ConnectedPoint) -> Self::Handler
Builds the protocols handler. Read more
source§fn inbound_protocol(
&self
) -> <Self::Handler as ConnectionHandler>::InboundProtocol
fn inbound_protocol(
&self
) -> <Self::Handler as ConnectionHandler>::InboundProtocol
Return the handler’s inbound protocol.
source§fn select<TProto2>(
self,
other: TProto2
) -> IntoConnectionHandlerSelect<Self, TProto2>where
Self: Sized,
fn select<TProto2>(
self,
other: TProto2
) -> IntoConnectionHandlerSelect<Self, TProto2>where
Self: Sized,
Builds an implementation of
IntoConnectionHandler
that handles both this protocol and the
other one together. Read more