Trait tet_libp2p::OutboundUpgrade[][src]

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

Possible upgrade on an outbound connection or substream.

Associated Types

type Output[src]

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

type Error[src]

Possible error during the handshake.

type Future: Future[src]

Future that performs the handshake with the remote.

Loading content...

Required methods

pub fn upgrade_outbound(self, socket: C, info: Self::Info) -> Self::Future[src]

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 OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for Ping[src]

type Output = Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>

type Error = Void

type Future = Ready<Result<<Ping as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output, <Ping as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>>

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]

type Output = DeflateOutput<C>

type Error = Error

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

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

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

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 RemuxConfig where
    C: AsyncRead + AsyncWrite + Send + Unpin + 'static, 
[src]

type Output = Remux<Incoming<C>>

type Error = Error

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

impl<C> OutboundUpgrade<C> for RemuxLocalConfig 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,
    P: ProtocolName + Clone,
    Fut: Future<Output = Result<Out, Err>>, 
[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, 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, Global>>

impl<TCodec> OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for RequestProtocol<TCodec> where
    TCodec: RequestResponseCodec + Send + 'static, 
[src]

type Output = <TCodec as RequestResponseCodec>::Response

type Error = Error

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

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

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

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

Loading content...