Struct libp2p::swarm::protocols_handler::SubstreamProtocol [−][src]
pub struct SubstreamProtocol<TUpgrade, TInfo> { /* fields omitted */ }Expand description
Configuration of inbound or outbound substream protocol(s)
for a ProtocolsHandler.
The inbound substream protocol(s) are defined by ProtocolsHandler::listen_protocol
and the outbound substream protocol(s) by ProtocolsHandlerEvent::OutboundSubstreamRequest.
Implementations
Create a new SubstreamProtocol from the given upgrade.
The default timeout for applying the given upgrade on a substream is 10 seconds.
pub fn map_upgrade<U, F>(self, f: F) -> SubstreamProtocol<U, TInfo> where
F: FnOnce(TUpgrade) -> U, [src]
pub fn map_upgrade<U, F>(self, f: F) -> SubstreamProtocol<U, TInfo> where
F: FnOnce(TUpgrade) -> U, [src]Maps a function over the protocol upgrade.
pub fn map_info<U, F>(self, f: F) -> SubstreamProtocol<TUpgrade, U> where
F: FnOnce(TInfo) -> U, [src]
pub fn map_info<U, F>(self, f: F) -> SubstreamProtocol<TUpgrade, U> where
F: FnOnce(TInfo) -> U, [src]Maps a function over the protocol info.
Sets a new timeout for the protocol upgrade.
Converts the substream protocol configuration into the contained upgrade.
Trait Implementations
impl<TUpgrade, TInfo> Clone for SubstreamProtocol<TUpgrade, TInfo> where
TUpgrade: Clone,
TInfo: Clone, [src]
impl<TUpgrade, TInfo> Clone for SubstreamProtocol<TUpgrade, TInfo> where
TUpgrade: Clone,
TInfo: Clone, [src]impl<TUpgrade, TInfo> Debug for SubstreamProtocol<TUpgrade, TInfo> where
TUpgrade: Debug,
TInfo: Debug, [src]
impl<TUpgrade, TInfo> Debug for SubstreamProtocol<TUpgrade, TInfo> where
TUpgrade: Debug,
TInfo: Debug, [src]impl<TUpgrade, TInfo> PartialEq<SubstreamProtocol<TUpgrade, TInfo>> for SubstreamProtocol<TUpgrade, TInfo> where
TUpgrade: PartialEq<TUpgrade>,
TInfo: PartialEq<TInfo>, [src]
impl<TUpgrade, TInfo> PartialEq<SubstreamProtocol<TUpgrade, TInfo>> for SubstreamProtocol<TUpgrade, TInfo> where
TUpgrade: PartialEq<TUpgrade>,
TInfo: PartialEq<TInfo>, [src]This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
impl<TUpgrade, TInfo> Copy for SubstreamProtocol<TUpgrade, TInfo> where
TUpgrade: Copy,
TInfo: Copy, [src]impl<TUpgrade, TInfo> Eq for SubstreamProtocol<TUpgrade, TInfo> where
TUpgrade: Eq,
TInfo: Eq, [src]Auto Trait Implementations
impl<TUpgrade, TInfo> RefUnwindSafe for SubstreamProtocol<TUpgrade, TInfo> where
TInfo: RefUnwindSafe,
TUpgrade: RefUnwindSafe, impl<TUpgrade, TInfo> Send for SubstreamProtocol<TUpgrade, TInfo> where
TInfo: Send,
TUpgrade: Send, impl<TUpgrade, TInfo> Sync for SubstreamProtocol<TUpgrade, TInfo> where
TInfo: Sync,
TUpgrade: Sync, impl<TUpgrade, TInfo> Unpin for SubstreamProtocol<TUpgrade, TInfo> where
TInfo: Unpin,
TUpgrade: Unpin, impl<TUpgrade, TInfo> UnwindSafe for SubstreamProtocol<TUpgrade, TInfo> where
TInfo: UnwindSafe,
TUpgrade: UnwindSafe, Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V