Struct libp2p_swarm::protocols_handler::multi::IntoMultiHandler
source · [−]pub struct IntoMultiHandler<K, H> { /* private fields */ }
Expand description
A IntoProtocolsHandler
for multiple other IntoProtocolsHandler
s.
Implementations
sourceimpl<K, H> IntoMultiHandler<K, H> where
K: Hash + Eq,
H: IntoProtocolsHandler,
impl<K, H> IntoMultiHandler<K, H> where
K: Hash + Eq,
H: IntoProtocolsHandler,
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.
Note: All handlers should use the same
upgrade::Version
for the inbound and outboundSubstreamProtocol
s.
Trait Implementations
sourceimpl<K: Clone, H: Clone> Clone for IntoMultiHandler<K, H>
impl<K: Clone, H: Clone> Clone for IntoMultiHandler<K, H>
sourcefn clone(&self) -> IntoMultiHandler<K, H>
fn clone(&self) -> IntoMultiHandler<K, H>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<K, H> IntoProtocolsHandler for IntoMultiHandler<K, H> where
K: Clone + Eq + Hash + Send + 'static,
H: IntoProtocolsHandler,
impl<K, H> IntoProtocolsHandler for IntoMultiHandler<K, H> where
K: Clone + Eq + Hash + Send + 'static,
H: IntoProtocolsHandler,
type Handler = MultiHandler<K, H::Handler>
type Handler = MultiHandler<K, H::Handler>
The protocols handler.
sourcefn 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
sourcefn inbound_protocol(
&self
) -> <Self::Handler as ProtocolsHandler>::InboundProtocol
fn inbound_protocol(
&self
) -> <Self::Handler as ProtocolsHandler>::InboundProtocol
Return the handler’s inbound protocol.
sourcefn select<TProto2>(
self,
other: TProto2
) -> IntoProtocolsHandlerSelect<Self, TProto2> where
Self: Sized,
fn select<TProto2>(
self,
other: TProto2
) -> IntoProtocolsHandlerSelect<Self, TProto2> where
Self: Sized,
Builds an implementation of IntoProtocolsHandler
that handles both this protocol and the
other one together. Read more
sourcefn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self> where
Self: Sized,
fn into_node_handler_builder(self) -> NodeHandlerWrapperBuilder<Self> where
Self: Sized,
Creates a builder that will allow creating a NodeHandler
that handles this protocol
exclusively. Read more
Auto Trait Implementations
impl<K, H> RefUnwindSafe for IntoMultiHandler<K, H> where
H: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, H> Send for IntoMultiHandler<K, H> where
H: Send,
K: Send,
impl<K, H> Sync for IntoMultiHandler<K, H> where
H: Sync,
K: Sync,
impl<K, H> Unpin for IntoMultiHandler<K, H> where
H: Unpin,
K: Unpin,
impl<K, H> UnwindSafe for IntoMultiHandler<K, H> where
H: UnwindSafe,
K: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more