[][src]Trait libp2p::InboundUpgrade

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

Possible upgrade on an inbound 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_inbound(
    self,
    socket: Negotiated<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> InboundUpgrade<C> for DeniedUpgrade[src]

type Output = Void

type Error = Void

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

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

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

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

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

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

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

type Output = Yamux<Negotiated<C>>

type Error = Error

type Future = FutureResult<Yamux<Negotiated<C>>, Error>

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> InboundUpgrade<C> for SimpleProtocol<F> where
    C: AsyncRead + AsyncWrite,
    F: Fn(Negotiated<C>) -> O,
    O: IntoFuture<Error = IoError>, 
[src]

type Output = O::Item

type Error = IoError

type Future = FromErr<O::Future, IoError>

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> InboundUpgrade<T> for SecioConfig where
    T: AsyncRead + AsyncWrite + Send + 'static, 
[src]

type Output = SecioOutput<Negotiated<T>>

type Error = SecioError

type Future = Box<dyn Future<Item = <SecioConfig as InboundUpgrade<T>>::Output, Error = <SecioConfig as InboundUpgrade<T>>::Error> + 'static + Send>

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

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

type Error = NoiseError

type Future = Handshake<Negotiated<T>, C>

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

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

type Error = NoiseError

type Future = Handshake<Negotiated<T>, C>

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

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

type Error = NoiseError

type Future = Handshake<Negotiated<T>, C>

impl<TSocket> InboundUpgrade<TSocket> for FloodsubConfig where
    TSocket: AsyncRead + AsyncWrite
[src]

impl<TSocket> InboundUpgrade<TSocket> for Ping where
    TSocket: AsyncRead + AsyncWrite
[src]

type Output = ()

type Error = Error

type Future = Map<AndThen<AndThen<AndThen<ReadExact<Negotiated<TSocket>, [u8; 32]>, WriteAll<Negotiated<TSocket>, [u8; 32]>, fn((Negotiated<TSocket>, [u8; 32])) -> WriteAll<Negotiated<TSocket>, [u8; 32]>>, Flush<Negotiated<TSocket>>, fn((Negotiated<TSocket>, [u8; 32])) -> Flush<Negotiated<TSocket>>>, Shutdown<Negotiated<TSocket>>, fn(Negotiated<TSocket>) -> Shutdown<Negotiated<TSocket>>>, fn(Negotiated<TSocket>)>

Loading content...