Trait libp2p::InboundUpgrade [−][src]
pub trait InboundUpgrade<C>: UpgradeInfo { type Output; type Error; type Future: Future; fn upgrade_inbound(self, socket: C, info: Self::Info) -> Self::Future; }
Expand description
Possible upgrade on an inbound connection or substream.
Associated Types
Output after the upgrade has been successfully negotiated and the handshake performed.
Required methods
fn upgrade_inbound(self, socket: C, info: Self::Info) -> Self::Future
fn upgrade_inbound(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> InboundUpgrade<C> for PlainText2Config where
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
impl<C> InboundUpgrade<C> for YamuxConfig where
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
impl<C> InboundUpgrade<C> for YamuxLocalConfig where
C: AsyncRead + AsyncWrite + Unpin + 'static,
impl<C, A, B, TA, TB, EA, EB> InboundUpgrade<C> for EitherUpgrade<A, B> where
A: InboundUpgrade<C, Output = TA, Error = EA>,
B: InboundUpgrade<C, Output = TB, Error = EB>,
impl<C, A, B, TA, TB, EA, EB> InboundUpgrade<C> for SelectUpgrade<A, B> where
A: InboundUpgrade<C, Output = TA, Error = EA>,
B: InboundUpgrade<C, Output = TB, Error = EB>,
impl<C, F, O, A, E> InboundUpgrade<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> InboundUpgrade<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> InboundUpgrade<C> for MapInboundUpgrade<U, F> where
F: FnOnce(<U as InboundUpgrade<C>>::Output) -> T,
U: InboundUpgrade<C>,
impl<C, U, F, T> InboundUpgrade<C> for MapInboundUpgradeErr<U, F> where
F: FnOnce(<U as InboundUpgrade<C>>::Error) -> T,
U: InboundUpgrade<C>,
impl<T, C> InboundUpgrade<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> InboundUpgrade<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, C, R> InboundUpgrade<T> for NoiseConfig<IK, C, R> where
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
NoiseConfig<IK, C, R>: UpgradeInfo,
impl<T, P, C, R> InboundUpgrade<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>: InboundUpgrade<T>,
NoiseConfig<P, C, R>: 'static,
<NoiseConfig<P, C, R> as InboundUpgrade<T>>::Future: Send,
<NoiseConfig<P, C, R> as InboundUpgrade<T>>::Output == (RemoteIdentity<C>, NoiseOutput<T>),
<NoiseConfig<P, C, R> as InboundUpgrade<T>>::Error == NoiseError,
impl<TCodec> InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for ResponseProtocol<TCodec> where
TCodec: RequestResponseCodec + Send + 'static,
impl<TSocket> InboundUpgrade<TSocket> for FloodsubProtocol where
TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
impl<TSocket> InboundUpgrade<TSocket> for ProtocolConfig where
TSocket: AsyncRead + AsyncWrite + Unpin + Send + 'static,