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§

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

Implementors§

source§

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

source§

impl<C> OutboundUpgrade<C> for DeflateConfigwhere C: AsyncRead + AsyncWrite,

source§

impl<C> OutboundUpgrade<C> for KademliaProtocolConfigwhere C: AsyncRead + AsyncWrite + Unpin,

§

type Output = AndThen<With<ErrInto<Framed<C, UviBytes<Cursor<Vec<u8, Global>>>>, Error>, Cursor<Vec<u8, Global>>, KadRequestMsg, Ready<Result<Cursor<Vec<u8, Global>>, Error>>, fn(_: KadRequestMsg) -> Ready<Result<Cursor<Vec<u8, Global>>, Error>>>, Ready<Result<KadResponseMsg, Error>>, fn(_: BytesMut) -> Ready<Result<KadResponseMsg, Error>>>

§

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

§

type Error = Error

source§

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

source§

impl<C> OutboundUpgrade<C> for PlainText1Config

§

type Output = C

§

type Error = Void

§

type Future = Ready<Result<C, <PlainText1Config as OutboundUpgrade<C>>::Error>>

source§

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

§

type Output = (PeerId, PlainTextOutput<C>)

§

type Error = PlainTextError

§

type Future = Pin<Box<dyn Future<Output = Result<<PlainText2Config as OutboundUpgrade<C>>::Output, <PlainText2Config as OutboundUpgrade<C>>::Error>> + Send + 'static, Global>>

source§

impl<C> OutboundUpgrade<C> for Configwhere C: AsyncRead + AsyncWrite + Send + Unpin + 'static,

§

type Output = (PeerId, TlsStream<C>)

§

type Error = UpgradeError

§

type Future = Pin<Box<dyn Future<Output = Result<<Config as OutboundUpgrade<C>>::Output, <Config as OutboundUpgrade<C>>::Error>> + Send + 'static, Global>>

source§

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

source§

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

source§

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

§

type Output = EitherOutput<TA, TB>

§

type Error = EitherError<EA, EB>

§

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

source§

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 = EitherOutput<TA, TB>

§

type Error = EitherError<EA, EB>

§

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

source§

impl<C, F, O, A, E> OutboundUpgrade<C> for SimpleProtocol<F>where C: AsyncRead + AsyncWrite, F: Fn(C) -> O, O: Future<Output = Result<A, E>>,

§

type Output = A

§

type Error = E

§

type Future = O

source§

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

§

type Output = Void

§

type Error = Void

§

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

source§

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

§

type Output = C

§

type Error = Void

§

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

source§

impl<C, P, F, Fut, Err, Out> OutboundUpgrade<C> for FromFnUpgrade<P, F>where P: ProtocolName + Clone, F: FnOnce(C, Endpoint) -> Fut, Fut: Future<Output = Result<Out, Err>>,

§

type Output = Out

§

type Error = Err

§

type Future = Fut

source§

impl<C, T> OutboundUpgrade<C> for OptionalUpgrade<T>where T: OutboundUpgrade<C>,

§

type Output = <T as OutboundUpgrade<C>>::Output

§

type Error = <T as OutboundUpgrade<C>>::Error

§

type Future = <T as OutboundUpgrade<C>>::Future

source§

impl<C, U, F> OutboundUpgrade<C> for MapInboundUpgrade<U, F>where U: OutboundUpgrade<C>,

§

type Output = <U as OutboundUpgrade<C>>::Output

§

type Error = <U as OutboundUpgrade<C>>::Error

§

type Future = <U as OutboundUpgrade<C>>::Future

source§

impl<C, U, F> OutboundUpgrade<C> for MapInboundUpgradeErr<U, F>where U: OutboundUpgrade<C>,

§

type Output = <U as OutboundUpgrade<C>>::Output

§

type Error = <U as OutboundUpgrade<C>>::Error

§

type Future = <U as OutboundUpgrade<C>>::Future

source§

impl<C, U, F, T> OutboundUpgrade<C> for MapOutboundUpgrade<U, F>where U: OutboundUpgrade<C>, F: FnOnce(<U as OutboundUpgrade<C>>::Output) -> T,

§

type Output = T

§

type Error = <U as OutboundUpgrade<C>>::Error

§

type Future = MapFuture<<U as OutboundUpgrade<C>>::Future, F>

source§

impl<C, U, F, T> OutboundUpgrade<C> for MapOutboundUpgradeErr<U, F>where U: OutboundUpgrade<C>, F: FnOnce(<U as OutboundUpgrade<C>>::Error) -> T,

§

type Output = <U as OutboundUpgrade<C>>::Output

§

type Error = T

§

type Future = MapErrFuture<<U as OutboundUpgrade<C>>::Future, F>

source§

impl<T> OutboundUpgrade<Negotiated<SubstreamBox>> for SendWrapper<T>where T: OutboundUpgradeSend,

source§

impl<T, C> OutboundUpgrade<T> for NoiseConfig<IK, C, (PublicKey<C>, PublicKey)>where NoiseConfig<IK, C, (PublicKey<C>, PublicKey)>: UpgradeInfo, T: AsyncRead + AsyncWrite + Unpin + Send + 'static, C: Protocol<C> + AsRef<[u8]> + Zeroize + Clone + Send + 'static,

Implements the initiator part of the IK handshake pattern.

IK is a single round-trip (2 messages) handshake.

In the IK handshake, the initiator knows and pre-configures the remote’s identity in the HandshakeState.

initiator -{id}-> responder
initiator <-{id}- responder
§

type Output = (RemoteIdentity<C>, NoiseOutput<T>)

§

type Error = NoiseError

§

type Future = Pin<Box<dyn Future<Output = Result<(RemoteIdentity<C>, NoiseOutput<T>), NoiseError>> + Send + 'static, Global>>

source§

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

Implements the initiator part of the IX noise handshake pattern.

IX is a single round-trip (2 messages) handshake in which each party sends their identity over to the other party.

initiator -{id}-> responder
initiator <-{id}- responder
§

type Output = (RemoteIdentity<C>, NoiseOutput<T>)

§

type Error = NoiseError

§

type Future = Pin<Box<dyn Future<Output = Result<(RemoteIdentity<C>, NoiseOutput<T>), NoiseError>> + Send + 'static, Global>>

source§

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

Implements the initiator part of the XX noise handshake pattern.

XX is a 1.5 round-trip (3 messages) handshake. The first message in a noise handshake is unencrypted. In the XX handshake pattern, that message is empty and thus does not leak any information. The identities are then exchanged in the second and third message.

initiator --{}--> responder
initiator <-{id}- responder
initiator -{id}-> responder
§

type Output = (RemoteIdentity<C>, NoiseOutput<T>)

§

type Error = NoiseError

§

type Future = Pin<Box<dyn Future<Output = Result<(RemoteIdentity<C>, NoiseOutput<T>), NoiseError>> + Send + 'static, Global>>

source§

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

§

type Output = (PeerId, NoiseOutput<T>)

§

type Error = NoiseError

§

type Future = Pin<Box<dyn Future<Output = Result<<NoiseAuthenticated<P, C, R> as OutboundUpgrade<T>>::Output, <NoiseAuthenticated<P, C, R> as OutboundUpgrade<T>>::Error>> + Send + 'static, Global>>

source§

impl<TCodec> OutboundUpgrade<Negotiated<SubstreamBox>> for RequestProtocol<TCodec>where TCodec: RequestResponseCodec + Send + 'static,

§

type Output = <TCodec as RequestResponseCodec>::Response

§

type Error = Error

§

type Future = Pin<Box<dyn Future<Output = Result<<RequestProtocol<TCodec> as OutboundUpgrade<Negotiated<SubstreamBox>>>::Output, <RequestProtocol<TCodec> as OutboundUpgrade<Negotiated<SubstreamBox>>>::Error>> + Send + 'static, Global>>

source§

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

§

type Output = ()

§

type Error = Error

§

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

source§

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

§

type Output = (Framed<TSocket, GossipsubCodec>, PeerKind)

§

type Error = GossipsubHandlerError

§

type Future = Pin<Box<dyn Future<Output = Result<<ProtocolConfig as OutboundUpgrade<TSocket>>::Output, <ProtocolConfig as OutboundUpgrade<TSocket>>::Error>> + Send + 'static, Global>>