Struct libp2p_swarm::handler::multi::IntoMultiHandler
source · [−]pub struct IntoMultiHandler<K, H> { /* private fields */ }
Expand description
A IntoConnectionHandler
for multiple other IntoConnectionHandler
s.
Implementations
sourceimpl<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
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> 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::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 ConnectionHandler>::InboundProtocol
fn inbound_protocol(
&self
) -> <Self::Handler as ConnectionHandler>::InboundProtocol
Return the handler’s inbound protocol.
sourcefn 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
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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more