libp2p::core::upgrade

Trait InboundConnectionUpgrade

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

    // Required method
    fn upgrade_inbound(self, socket: T, info: Self::Info) -> Self::Future;
}
Expand description

Possible upgrade on an inbound connection

Required Associated Types§

type Output

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

type Error

Possible error during the handshake.

type Future: Future<Output = Result<Self::Output, Self::Error>>

Future that performs the handshake with the remote.

Required Methods§

fn upgrade_inbound(self, socket: T, 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> InboundConnectionUpgrade<C> for libp2p::plaintext::Config
where C: AsyncRead + AsyncWrite + Send + Unpin + 'static,

§

impl<C> InboundConnectionUpgrade<C> for libp2p::tls::Config
where C: AsyncRead + AsyncWrite + Send + Unpin + 'static,

§

impl<C> InboundConnectionUpgrade<C> for libp2p::yamux::Config
where C: AsyncRead + AsyncWrite + Send + Unpin + 'static,

§

impl<C, A, B, TA, TB, EA, EB> InboundConnectionUpgrade<C> for SelectUpgrade<A, B>
where A: InboundConnectionUpgrade<C, Output = TA, Error = EA>, B: InboundConnectionUpgrade<C, Output = TB, Error = EB>,

§

type Output = Either<TA, TB>

§

type Error = Either<EA, EB>

§

type Future = EitherFuture<<A as InboundConnectionUpgrade<C>>::Future, <B as InboundConnectionUpgrade<C>>::Future>

§

impl<T> InboundConnectionUpgrade<T> for libp2p::noise::Config
where T: AsyncRead + AsyncWrite + Unpin + Send + 'static,