Trait tetsy_libp2p::InboundUpgrade[][src]

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

Possible upgrade on an inbound 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_inbound(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 InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for Ping[src]

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

type Error = Void

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

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

type Output = Void

type Error = Void

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

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

type Output = DeflateOutput<C>

type Error = Error

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

impl<C> InboundUpgrade<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>>, KadResponseMsg, Ready<Result<Cursor<Vec<u8, Global>>, Error>>, fn(KadResponseMsg) -> Ready<Result<Cursor<Vec<u8, Global>>, Error>>>, Ready<Result<KadRequestMsg, Error>>, fn(BytesMut) -> Ready<Result<KadRequestMsg, Error>>>

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

type Error = Error

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

type Output = Multiplex<C>

type Error = Error

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

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

type Output = C

type Error = Void

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

impl<C> InboundUpgrade<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 InboundUpgrade<C>>::Output, <PlainText2Config as InboundUpgrade<C>>::Error>> + 'static + Send, Global>>

impl<C> InboundUpgrade<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 InboundUpgrade<C>>::Output, <RemuxConfig as InboundUpgrade<C>>::Error>>

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

impl<C, A, B, TA, TB, EA, EB> InboundUpgrade<C> for EitherUpgrade<A, B> where
    A: InboundUpgrade<C, Output = TA, Error = EA>,
    B: InboundUpgrade<C, Output = TB, Error = EB>, 
[src]

type Output = EitherOutput<TA, TB>

type Error = EitherError<EA, EB>

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

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

type Output = EitherOutput<TA, TB>

type Error = EitherError<EA, EB>

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

impl<C, F, O, A, E> InboundUpgrade<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> InboundUpgrade<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> InboundUpgrade<C> for OptionalUpgrade<T> where
    T: InboundUpgrade<C>, 
[src]

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

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

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

impl<C, U, F> InboundUpgrade<C> for MapOutboundUpgrade<U, F> where
    U: InboundUpgrade<C>, 
[src]

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

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

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

impl<C, U, F> InboundUpgrade<C> for MapOutboundUpgradeErr<U, F> where
    U: InboundUpgrade<C>, 
[src]

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

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

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

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

type Output = T

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

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

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

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

type Error = T

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

impl<T, C> InboundUpgrade<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> InboundUpgrade<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, C, R> InboundUpgrade<T> for NoiseConfig<IK, C, R> where
    C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
    T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
    NoiseConfig<IK, C, R>: UpgradeInfo
[src]

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

type Error = NoiseError

type Future = Handshake<T, C>

impl<T, P, C, R> InboundUpgrade<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>: InboundUpgrade<T>,
    NoiseConfig<P, C, R>: 'static,
    <NoiseConfig<P, C, R> as InboundUpgrade<T>>::Future: Send,
    <NoiseConfig<P, C, R> as InboundUpgrade<T>>::Output == (RemoteIdentity<C>, NoiseOutput<T>),
    <NoiseConfig<P, C, R> as InboundUpgrade<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 InboundUpgrade<T>>::Output, <NoiseAuthenticated<P, C, R> as InboundUpgrade<T>>::Error>> + 'static + Send, Global>>

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

type Output = bool

type Error = Error

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

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

type Output = FloodsubRpc

type Error = FloodsubDecodeError

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

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

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

type Error = GossipsubHandlerError

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

Loading content...