Trait libp2p::OutboundUpgrade

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

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

Possible upgrade on an outbound connection or substream.

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_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.

Implementations on Foreign Types§

§

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

§

type Output = Either<TA, TB>

§

type Error = Either<EA, EB>

§

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

§

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

Implementors§

§

impl<C> OutboundUpgrade<C> for DeniedUpgrade

§

type Output = Void

§

type Error = Void

§

type Future = Pending<Result<<DeniedUpgrade as OutboundUpgrade<C>>::Output, <DeniedUpgrade as OutboundUpgrade<C>>::Error>>

§

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

§

type Output = Either<TA, TB>

§

type Error = Either<EA, EB>

§

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

§

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

§

type Output = Void

§

type Error = Void

§

type Future = Pending<Result<<PendingUpgrade<P> as OutboundUpgrade<C>>::Output, <PendingUpgrade<P> as OutboundUpgrade<C>>::Error>>

§

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

§

type Output = C

§

type Error = Void

§

type Future = Ready<Result<<ReadyUpgrade<P> as OutboundUpgrade<C>>::Output, <ReadyUpgrade<P> as OutboundUpgrade<C>>::Error>>

§

impl<T> OutboundUpgrade<Stream> for SendWrapper<T>

§

impl<TSocket> OutboundUpgrade<TSocket> for FloodsubRpc
where TSocket: AsyncWrite + AsyncRead + Send + Unpin + 'static,

§

type Output = ()

§

type Error = CodecError

§

type Future = Pin<Box<dyn Future<Output = Result<<FloodsubRpc as OutboundUpgrade<TSocket>>::Output, <FloodsubRpc as OutboundUpgrade<TSocket>>::Error>> + Send>>