Trait libp2p::OutboundUpgrade [−][src]
pub trait OutboundUpgrade<C>: UpgradeInfo { type Output; type Error; type Future: Future; fn upgrade_outbound(self, socket: C, info: Self::Info) -> Self::Future; }
Expand description
Possible upgrade on an outbound connection or substream.
Associated Types
Output after the upgrade has been successfully negotiated and the handshake performed.
Required methods
fn upgrade_outbound(self, socket: C, info: Self::Info) -> Self::Future
fn upgrade_outbound(self, socket: C, info: Self::Info) -> Self::Future
After we have determined that the remote supports one of the protocols we support, this method is called to start the handshake.
The info
is the identifier of the protocol, as produced by protocol_info
.
Implementors
impl<C> OutboundUpgrade<C> for PlainText2Config where
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
impl<C> OutboundUpgrade<C> for YamuxConfig where
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
impl<C> OutboundUpgrade<C> for YamuxLocalConfig where
C: AsyncRead + AsyncWrite + Unpin + 'static,
impl<C, A, B, TA, TB, EA, EB> OutboundUpgrade<C> for EitherUpgrade<A, B> where
A: OutboundUpgrade<C, Output = TA, Error = EA>,
B: OutboundUpgrade<C, Output = TB, Error = EB>,
impl<C, A, B, TA, TB, EA, EB> OutboundUpgrade<C> for SelectUpgrade<A, B> where
A: OutboundUpgrade<C, Output = TA, Error = EA>,
B: OutboundUpgrade<C, Output = TB, Error = EB>,
impl<C, F, O, A, E> OutboundUpgrade<C> for SimpleProtocol<F> where
C: AsyncRead + AsyncWrite,
F: Fn(C) -> O,
O: Future<Output = Result<A, E>>,
impl<C, P, F, Fut, Err, Out> OutboundUpgrade<C> for FromFnUpgrade<P, F> where
F: FnOnce(C, Endpoint) -> Fut,
P: ProtocolName + Clone,
Fut: Future<Output = Result<Out, Err>>,
impl<C, U, F, T> OutboundUpgrade<C> for MapOutboundUpgrade<U, F> where
F: FnOnce(<U as OutboundUpgrade<C>>::Output) -> T,
U: OutboundUpgrade<C>,
impl<C, U, F, T> OutboundUpgrade<C> for MapOutboundUpgradeErr<U, F> where
F: FnOnce(<U as OutboundUpgrade<C>>::Error) -> T,
U: OutboundUpgrade<C>,
impl<T, C> OutboundUpgrade<T> for NoiseConfig<IK, C, (PublicKey<C>, PublicKey)> where
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
NoiseConfig<IK, C, (PublicKey<C>, PublicKey)>: UpgradeInfo,
impl<T, C> OutboundUpgrade<T> for NoiseConfig<IX, C, ()> where
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
NoiseConfig<IX, C, ()>: UpgradeInfo,
impl<T, C> OutboundUpgrade<T> for NoiseConfig<XX, C, ()> where
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
NoiseConfig<XX, C, ()>: UpgradeInfo,
impl<T, P, C, R> OutboundUpgrade<T> for NoiseAuthenticated<P, C, R> where
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Send + 'static,
NoiseConfig<P, C, R>: UpgradeInfo,
NoiseConfig<P, C, R>: OutboundUpgrade<T>,
NoiseConfig<P, C, R>: 'static,
<NoiseConfig<P, C, R> as OutboundUpgrade<T>>::Future: Send,
<NoiseConfig<P, C, R> as OutboundUpgrade<T>>::Output == (RemoteIdentity<C>, NoiseOutput<T>),
<NoiseConfig<P, C, R> as OutboundUpgrade<T>>::Error == NoiseError,
impl<TCodec> OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for RequestProtocol<TCodec> where
TCodec: RequestResponseCodec + Send + 'static,
impl<TSocket> OutboundUpgrade<TSocket> for FloodsubRpc where
TSocket: AsyncWrite + AsyncRead + Send + Unpin + 'static,
impl<TSocket> OutboundUpgrade<TSocket> for ProtocolConfig where
TSocket: AsyncWrite + AsyncRead + Unpin + Send + 'static,