[][src]Trait libp2p::core::upgrade::OutboundUpgrade

pub trait OutboundUpgrade<C>: UpgradeInfo where
    <Self::Future as Future>::Output == Result<Self::Output, Self::Error>, 
{ type Output; type Error; type Future: Future; fn upgrade_outbound(self, socket: C, info: Self::Info) -> Self::Future; }

Possible upgrade on an outbound connection or substream.

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

Future that performs the handshake with the remote.

Loading content...

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.

Loading content...

Implementors

impl<C> OutboundUpgrade<C> for DeniedUpgrade[src]

type Output = Void

type Error = Void

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

impl<C> OutboundUpgrade<C> for DeflateConfig where
    C: AsyncRead + AsyncWrite
[src]

impl<C> OutboundUpgrade<C> for KademliaProtocolConfig where
    C: AsyncRead + AsyncWrite + Unpin
[src]

impl<C> OutboundUpgrade<C> for MplexConfig where
    C: AsyncRead + AsyncWrite + Unpin
[src]

type Output = Multiplex<C>

type Error = Error

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

impl<C> OutboundUpgrade<C> for PlainText1Config[src]

type Output = C

type Error = Void

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

impl<C> OutboundUpgrade<C> for PlainText2Config where
    C: AsyncRead + AsyncWrite + Send + Unpin + 'static, 
[src]

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>> + 'static + Send>>

impl<C> OutboundUpgrade<C> for Config where
    C: AsyncRead + AsyncWrite + Send + Unpin + 'static, 
[src]

type Output = Yamux<Incoming<C>>

type Error = Error

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

impl<C> OutboundUpgrade<C> for LocalConfig where
    C: AsyncRead + AsyncWrite + Unpin + 'static, 
[src]

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>, 
[src]

type Output = EitherOutput<TA, TB>

type Error = EitherError<EA, EB>

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

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>, 
[src]

type Output = EitherOutput<TA, TB>

type Error = EitherError<EA, EB>

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

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>>, 
[src]

type Output = A

type Error = E

type Future = O

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

type Output = Out

type Error = Err

type Future = Fut

impl<C, T> OutboundUpgrade<C> for OptionalUpgrade<T> where
    T: OutboundUpgrade<C>, 
[src]

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

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

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

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

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

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

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

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

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

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

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

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

type Output = T

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

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

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

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

type Error = T

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

impl<T> OutboundUpgrade<T> for SecioConfig where
    T: AsyncRead + AsyncWrite + Unpin + Send + 'static, 
[src]

type Output = (PeerId, SecioOutput<T>)

type Error = SecioError

type Future = Pin<Box<dyn Future<Output = Result<<SecioConfig as OutboundUpgrade<T>>::Output, <SecioConfig as OutboundUpgrade<T>>::Error>> + 'static + Send>>

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

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

type Error = NoiseError

type Future = Handshake<T, C>

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

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

type Error = NoiseError

type Future = Handshake<T, C>

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

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

type Error = NoiseError

type Future = Handshake<T, C>

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

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>> + 'static + Send>>

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

type Output = ()

type Error = Error

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

impl<TSocket> OutboundUpgrade<TSocket> for ProtocolConfig where
    TSocket: AsyncWrite + AsyncRead + Unpin + Send + 'static, 
[src]

type Output = Framed<TSocket, GossipsubCodec>

type Error = Error

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

impl<TSocket> OutboundUpgrade<TSocket> for Ping where
    TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static, 
[src]

type Output = Duration

type Error = Error

type Future = Pin<Box<dyn Future<Output = Result<Duration, Error>> + 'static + Send>>

Loading content...