pub trait InboundUpgrade<C>: UpgradeInfo {
    type Output;
    type Error;
    type Future: Future<Output = Result<Self::Output, Self::Error>>;

    fn upgrade_inbound(self, socket: C, info: Self::Info) -> Self::Future;
}
Expand description

Possible upgrade on an inbound connection or substream.

Required Associated Types§

Output after the upgrade has been successfully negotiated and the handshake performed.

Possible error during the handshake.

Future that performs the handshake with the remote.

Required Methods§

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, 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> InboundUpgrade<C> for DeflateConfigwhere
    C: AsyncRead + AsyncWrite,

impl<TSocket> InboundUpgrade<TSocket> for FloodsubProtocolwhere
    TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,

impl<TSocket> InboundUpgrade<TSocket> for ProtocolConfigwhere
    TSocket: AsyncRead + AsyncWrite + Unpin + Send + 'static,

impl<C> InboundUpgrade<C> for MplexConfigwhere
    C: AsyncRead + AsyncWrite + Unpin,

impl<T, C> InboundUpgrade<T> for NoiseConfig<IX, C>where
    NoiseConfig<IX, C>: UpgradeInfo,
    T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
    C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,

impl<T, C> InboundUpgrade<T> for NoiseConfig<XX, C>where
    NoiseConfig<XX, C>: UpgradeInfo,
    T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
    C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,

impl<T, C, R> InboundUpgrade<T> for NoiseConfig<IK, C, R>where
    NoiseConfig<IK, C, R>: UpgradeInfo,
    T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
    C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,

impl<T, P, C, R> InboundUpgrade<T> for NoiseAuthenticated<P, C, R>where
    NoiseConfig<P, C, R>: UpgradeInfo + InboundUpgrade<T, Output = (RemoteIdentity<C>, NoiseOutput<T>), Error = NoiseError> + 'static,
    <NoiseConfig<P, C, R> as InboundUpgrade<T>>::Future: Send,
    T: AsyncRead + AsyncWrite + Send + 'static,
    C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,

impl<C> InboundUpgrade<C> for PlainText2Configwhere
    C: AsyncRead + AsyncWrite + Send + Unpin + 'static,

impl<TCodec> InboundUpgrade<Negotiated<SubstreamBox>> for ResponseProtocol<TCodec>where
    TCodec: RequestResponseCodec + Send + 'static,

impl<C> InboundUpgrade<C> for YamuxConfigwhere
    C: AsyncRead + AsyncWrite + Send + Unpin + 'static,

impl<C> InboundUpgrade<C> for YamuxLocalConfigwhere
    C: AsyncRead + AsyncWrite + Unpin + 'static,

impl<TSocket> InboundUpgrade<TSocket> for BitswapConfigwhere
    TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,