Trait libp2p::InboundUpgrade

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

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

Possible upgrade on an inbound connection or substream.

Required Associated Types§

source

type Output

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

source

type Error

Possible error during the handshake.

source

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

Future that performs the handshake with the remote.

Required Methods§

source

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.

Implementations on Foreign Types§

source§

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

§

type Output = Either<TA, TB>

§

type Error = Either<EA, EB>

§

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

source§

fn upgrade_inbound( self, sock: C, info: <Either<A, B> as UpgradeInfo>::Info, ) -> <Either<A, B> as InboundUpgrade<C>>::Future

Implementors§

source§

impl<C> InboundUpgrade<C> for DeniedUpgrade

source§

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

source§

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>,

§

type Output = Either<TA, TB>

§

type Error = Either<EA, EB>

§

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

source§

impl<C, P> InboundUpgrade<C> for PendingUpgrade<P>
where P: AsRef<str> + Clone,

source§

impl<C, P> InboundUpgrade<C> for ReadyUpgrade<P>
where P: AsRef<str> + Clone,

source§

impl<T> InboundUpgrade<Stream> for SendWrapper<T>

source§

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

§

type Output = (PeerId, Output<T>)

§

type Error = Error

§

type Future = Pin<Box<dyn Future<Output = Result<<Config as InboundUpgrade<T>>::Output, <Config as InboundUpgrade<T>>::Error>> + Send>>