pub struct IntoMultiHandler<K, H> { /* private fields */ }
Expand description
A IntoProtocolsHandler
for multiple other IntoProtocolsHandler
s.
Implementations§
Source§impl<K, H> IntoMultiHandler<K, H>
impl<K, H> IntoMultiHandler<K, H>
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§
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 duplicate 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> Debug for IntoMultiHandler<K, H>
impl<K, H> Debug for IntoMultiHandler<K, H>
Source§impl<K, H> IntoProtocolsHandler for IntoMultiHandler<K, H>
impl<K, H> IntoProtocolsHandler for IntoMultiHandler<K, H>
Source§type Handler = MultiHandler<K, <H as IntoProtocolsHandler>::Handler>
type Handler = MultiHandler<K, <H as IntoProtocolsHandler>::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 ProtocolsHandler>::InboundProtocol
fn inbound_protocol( &self, ) -> <Self::Handler as ProtocolsHandler>::InboundProtocol
Return the handler’s inbound protocol.
Source§fn 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.Source§fn 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.Auto Trait Implementations§
impl<K, H> Freeze for IntoMultiHandler<K, H>
impl<K, H> RefUnwindSafe for IntoMultiHandler<K, H>where
K: RefUnwindSafe,
H: RefUnwindSafe,
impl<K, H> Send for IntoMultiHandler<K, H>
impl<K, H> Sync for IntoMultiHandler<K, H>
impl<K, H> Unpin for IntoMultiHandler<K, H>
impl<K, H> UnwindSafe for IntoMultiHandler<K, H>where
K: UnwindSafe,
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more