[−][src]Trait libp2p::InboundUpgrade
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.
Required methods
fn upgrade_inbound(
self,
socket: Negotiated<C>,
info: Self::Info
) -> Self::Future
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
.
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>
fn upgrade_inbound(
self,
Negotiated<C>,
<DeniedUpgrade as UpgradeInfo>::Info
) -> <DeniedUpgrade as InboundUpgrade<C>>::Future
[src]
self,
Negotiated<C>,
<DeniedUpgrade as UpgradeInfo>::Info
) -> <DeniedUpgrade as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for DeflateConfig where
C: AsyncRead + AsyncWrite,
[src]
C: AsyncRead + AsyncWrite,
type Output = DeflateDecoder<DeflateEncoder<Negotiated<C>>>
type Error = Error
type Future = FutureResult<<DeflateConfig as InboundUpgrade<C>>::Output, <DeflateConfig as InboundUpgrade<C>>::Error>
fn upgrade_inbound(
self,
r: Negotiated<C>,
<DeflateConfig as UpgradeInfo>::Info
) -> <DeflateConfig as InboundUpgrade<C>>::Future
[src]
self,
r: Negotiated<C>,
<DeflateConfig as UpgradeInfo>::Info
) -> <DeflateConfig as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for KademliaProtocolConfig where
C: AsyncRead + AsyncWrite,
[src]
C: AsyncRead + AsyncWrite,
type Output = AndThen<With<FromErr<Framed<Negotiated<C>, UviBytes<Vec<u8>>>, Error>, KadResponseMsg, fn(KadResponseMsg) -> Result<Vec<u8>, Error>, Result<Vec<u8>, Error>>, fn(BytesMut) -> Result<KadRequestMsg, Error>, Result<KadRequestMsg, Error>>
type Future = FutureResult<<KademliaProtocolConfig as InboundUpgrade<C>>::Output, Error>
type Error = Error
fn upgrade_inbound(
self,
incoming: Negotiated<C>,
<KademliaProtocolConfig as UpgradeInfo>::Info
) -> <KademliaProtocolConfig as InboundUpgrade<C>>::Future
[src]
self,
incoming: Negotiated<C>,
<KademliaProtocolConfig as UpgradeInfo>::Info
) -> <KademliaProtocolConfig as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for MplexConfig where
C: AsyncRead + AsyncWrite,
[src]
C: AsyncRead + AsyncWrite,
type Output = Multiplex<Negotiated<C>>
type Error = Error
type Future = FutureResult<<MplexConfig as InboundUpgrade<C>>::Output, Error>
fn upgrade_inbound(
self,
socket: Negotiated<C>,
<MplexConfig as UpgradeInfo>::Info
) -> <MplexConfig as InboundUpgrade<C>>::Future
[src]
self,
socket: Negotiated<C>,
<MplexConfig as UpgradeInfo>::Info
) -> <MplexConfig as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for PlainText1Config
[src]
type Output = Negotiated<C>
type Error = Void
type Future = FutureResult<Negotiated<C>, <PlainText1Config as InboundUpgrade<C>>::Error>
fn upgrade_inbound(
self,
i: Negotiated<C>,
<PlainText1Config as UpgradeInfo>::Info
) -> <PlainText1Config as InboundUpgrade<C>>::Future
[src]
self,
i: Negotiated<C>,
<PlainText1Config as UpgradeInfo>::Info
) -> <PlainText1Config as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for PlainText2Config where
C: AsyncRead + AsyncWrite + Send + 'static,
[src]
C: AsyncRead + AsyncWrite + Send + 'static,
type Output = (PeerId, PlainTextOutput<Negotiated<C>>)
type Error = PlainTextError
type Future = Box<dyn Future<Item = <PlainText2Config as InboundUpgrade<C>>::Output, Error = <PlainText2Config as InboundUpgrade<C>>::Error> + 'static + Send>
fn upgrade_inbound(
self,
socket: Negotiated<C>,
<PlainText2Config as UpgradeInfo>::Info
) -> <PlainText2Config as InboundUpgrade<C>>::Future
[src]
self,
socket: Negotiated<C>,
<PlainText2Config as UpgradeInfo>::Info
) -> <PlainText2Config as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for Config where
C: AsyncRead + AsyncWrite + 'static,
[src]
C: AsyncRead + AsyncWrite + 'static,
type Output = Yamux<Negotiated<C>>
type Error = Error
type Future = FutureResult<Yamux<Negotiated<C>>, Error>
fn upgrade_inbound(
self,
i: Negotiated<C>,
<Config as UpgradeInfo>::Info
) -> <Config as InboundUpgrade<C>>::Future
[src]
self,
i: Negotiated<C>,
<Config as UpgradeInfo>::Info
) -> <Config as InboundUpgrade<C>>::Future
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]
A: InboundUpgrade<C, Output = TA, Error = EA>,
B: InboundUpgrade<C, Output = TB, Error = EB>,
type Output = EitherOutput<TA, TB>
type Error = EitherError<EA, EB>
type Future = EitherFuture2<<A as InboundUpgrade<C>>::Future, <B as InboundUpgrade<C>>::Future>
fn upgrade_inbound(
self,
sock: Negotiated<C>,
info: <EitherUpgrade<A, B> as UpgradeInfo>::Info
) -> <EitherUpgrade<A, B> as InboundUpgrade<C>>::Future
[src]
self,
sock: Negotiated<C>,
info: <EitherUpgrade<A, B> as UpgradeInfo>::Info
) -> <EitherUpgrade<A, 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]
A: InboundUpgrade<C, Output = TA, Error = EA>,
B: InboundUpgrade<C, Output = TB, Error = EB>,
type Output = EitherOutput<TA, TB>
type Error = EitherError<EA, EB>
type Future = EitherFuture2<<A as InboundUpgrade<C>>::Future, <B as InboundUpgrade<C>>::Future>
fn upgrade_inbound(
self,
sock: Negotiated<C>,
info: <SelectUpgrade<A, B> as UpgradeInfo>::Info
) -> <SelectUpgrade<A, B> as InboundUpgrade<C>>::Future
[src]
self,
sock: Negotiated<C>,
info: <SelectUpgrade<A, B> as UpgradeInfo>::Info
) -> <SelectUpgrade<A, 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]
C: AsyncRead + AsyncWrite,
F: Fn(Negotiated<C>) -> O,
O: IntoFuture<Error = IoError>,
type Output = O::Item
type Error = IoError
type Future = FromErr<O::Future, IoError>
fn upgrade_inbound(self, socket: Negotiated<C>, _: Self::Info) -> Self::Future
[src]
impl<C, T> InboundUpgrade<C> for OptionalUpgrade<T> where
T: InboundUpgrade<C>,
[src]
T: InboundUpgrade<C>,
type Output = <T as InboundUpgrade<C>>::Output
type Error = <T as InboundUpgrade<C>>::Error
type Future = <T as InboundUpgrade<C>>::Future
fn upgrade_inbound(
self,
sock: Negotiated<C>,
info: <OptionalUpgrade<T> as UpgradeInfo>::Info
) -> <OptionalUpgrade<T> as InboundUpgrade<C>>::Future
[src]
self,
sock: Negotiated<C>,
info: <OptionalUpgrade<T> as UpgradeInfo>::Info
) -> <OptionalUpgrade<T> as InboundUpgrade<C>>::Future
impl<C, U, F> InboundUpgrade<C> for MapOutboundUpgrade<U, F> where
U: InboundUpgrade<C>,
[src]
U: InboundUpgrade<C>,
type Output = <U as InboundUpgrade<C>>::Output
type Error = <U as InboundUpgrade<C>>::Error
type Future = <U as InboundUpgrade<C>>::Future
fn upgrade_inbound(
self,
sock: Negotiated<C>,
info: <MapOutboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapOutboundUpgrade<U, F> as InboundUpgrade<C>>::Future
[src]
self,
sock: Negotiated<C>,
info: <MapOutboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapOutboundUpgrade<U, F> as InboundUpgrade<C>>::Future
impl<C, U, F> InboundUpgrade<C> for MapOutboundUpgradeErr<U, F> where
U: InboundUpgrade<C>,
[src]
U: InboundUpgrade<C>,
type Output = <U as InboundUpgrade<C>>::Output
type Error = <U as InboundUpgrade<C>>::Error
type Future = <U as InboundUpgrade<C>>::Future
fn upgrade_inbound(
self,
sock: Negotiated<C>,
info: <MapOutboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapOutboundUpgradeErr<U, F> as InboundUpgrade<C>>::Future
[src]
self,
sock: Negotiated<C>,
info: <MapOutboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapOutboundUpgradeErr<U, F> 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]
F: FnOnce(<U as InboundUpgrade<C>>::Output) -> T,
U: InboundUpgrade<C>,
type Output = T
type Error = <U as InboundUpgrade<C>>::Error
type Future = MapFuture<<U as InboundUpgrade<C>>::Future, F>
fn upgrade_inbound(
self,
sock: Negotiated<C>,
info: <MapInboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgrade<U, F> as InboundUpgrade<C>>::Future
[src]
self,
sock: Negotiated<C>,
info: <MapInboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgrade<U, F> as InboundUpgrade<C>>::Future
impl<C, U, F, T> InboundUpgrade<C> for MapInboundUpgradeErr<U, F> where
F: FnOnce(<U as InboundUpgrade<C>>::Error) -> T,
U: InboundUpgrade<C>,
[src]
F: FnOnce(<U as InboundUpgrade<C>>::Error) -> T,
U: InboundUpgrade<C>,
type Output = <U as InboundUpgrade<C>>::Output
type Error = T
type Future = MapErrFuture<<U as InboundUpgrade<C>>::Future, F>
fn upgrade_inbound(
self,
sock: Negotiated<C>,
info: <MapInboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgradeErr<U, F> as InboundUpgrade<C>>::Future
[src]
self,
sock: Negotiated<C>,
info: <MapInboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgradeErr<U, F> as InboundUpgrade<C>>::Future
impl<T> InboundUpgrade<T> for SecioConfig where
T: AsyncRead + AsyncWrite + Send + 'static,
[src]
T: AsyncRead + AsyncWrite + Send + 'static,
type Output = (PeerId, 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>
fn upgrade_inbound(
self,
socket: Negotiated<T>,
<SecioConfig as UpgradeInfo>::Info
) -> <SecioConfig as InboundUpgrade<T>>::Future
[src]
self,
socket: Negotiated<T>,
<SecioConfig as UpgradeInfo>::Info
) -> <SecioConfig as InboundUpgrade<T>>::Future
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]
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Send + 'static,
NoiseConfig<IK, C, ()>: UpgradeInfo,
type Output = (RemoteIdentity<C>, NoiseOutput<Negotiated<T>>)
type Error = NoiseError
type Future = Handshake<Negotiated<T>, C>
fn upgrade_inbound(
self,
socket: Negotiated<T>,
<NoiseConfig<IK, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<IK, C, ()> as InboundUpgrade<T>>::Future
[src]
self,
socket: Negotiated<T>,
<NoiseConfig<IK, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<IK, C, ()> as InboundUpgrade<T>>::Future
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]
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Send + 'static,
NoiseConfig<IX, C, ()>: UpgradeInfo,
type Output = (RemoteIdentity<C>, NoiseOutput<Negotiated<T>>)
type Error = NoiseError
type Future = Handshake<Negotiated<T>, C>
fn upgrade_inbound(
self,
socket: Negotiated<T>,
<NoiseConfig<IX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<IX, C, ()> as InboundUpgrade<T>>::Future
[src]
self,
socket: Negotiated<T>,
<NoiseConfig<IX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<IX, C, ()> as InboundUpgrade<T>>::Future
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]
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Send + 'static,
NoiseConfig<XX, C, ()>: UpgradeInfo,
type Output = (RemoteIdentity<C>, NoiseOutput<Negotiated<T>>)
type Error = NoiseError
type Future = Handshake<Negotiated<T>, C>
fn upgrade_inbound(
self,
socket: Negotiated<T>,
<NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<XX, C, ()> as InboundUpgrade<T>>::Future
[src]
self,
socket: Negotiated<T>,
<NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<XX, C, ()> as InboundUpgrade<T>>::Future
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> as InboundUpgrade<T>>::Output == (RemoteIdentity<C>, NoiseOutput<Negotiated<T>>),
<NoiseConfig<P, C, R> as InboundUpgrade<T>>::Error == NoiseError,
[src]
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> as InboundUpgrade<T>>::Output == (RemoteIdentity<C>, NoiseOutput<Negotiated<T>>),
<NoiseConfig<P, C, R> as InboundUpgrade<T>>::Error == NoiseError,
type Output = (PeerId, NoiseOutput<Negotiated<T>>)
type Error = NoiseError
type Future = AndThen<<NoiseConfig<P, C, R> as InboundUpgrade<T>>::Future, FutureResult<<NoiseAuthenticated<P, C, R> as InboundUpgrade<T>>::Output, <NoiseAuthenticated<P, C, R> as InboundUpgrade<T>>::Error>, fn((RemoteIdentity<C>, NoiseOutput<Negotiated<T>>)) -> FutureResult<<NoiseAuthenticated<P, C, R> as InboundUpgrade<T>>::Output, <NoiseAuthenticated<P, C, R> as InboundUpgrade<T>>::Error>>
fn upgrade_inbound(
self,
socket: Negotiated<T>,
info: <NoiseAuthenticated<P, C, R> as UpgradeInfo>::Info
) -> <NoiseAuthenticated<P, C, R> as InboundUpgrade<T>>::Future
[src]
self,
socket: Negotiated<T>,
info: <NoiseAuthenticated<P, C, R> as UpgradeInfo>::Info
) -> <NoiseAuthenticated<P, C, R> as InboundUpgrade<T>>::Future
impl<TSocket> InboundUpgrade<TSocket> for FloodsubConfig where
TSocket: AsyncRead + AsyncWrite,
[src]
TSocket: AsyncRead + AsyncWrite,
type Output = FloodsubRpc
type Error = FloodsubDecodeError
type Future = ReadOneThen<Negotiated<TSocket>, (), fn(Vec<u8>, ()) -> Result<FloodsubRpc, FloodsubDecodeError>>
fn upgrade_inbound(
self,
socket: Negotiated<TSocket>,
<FloodsubConfig as UpgradeInfo>::Info
) -> <FloodsubConfig as InboundUpgrade<TSocket>>::Future
[src]
self,
socket: Negotiated<TSocket>,
<FloodsubConfig as UpgradeInfo>::Info
) -> <FloodsubConfig as InboundUpgrade<TSocket>>::Future
impl<TSocket> InboundUpgrade<TSocket> for Ping where
TSocket: AsyncRead + AsyncWrite,
[src]
TSocket: AsyncRead + AsyncWrite,
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>)>
fn upgrade_inbound(
self,
socket: Negotiated<TSocket>,
<Ping as UpgradeInfo>::Info
) -> <Ping as InboundUpgrade<TSocket>>::Future
[src]
self,
socket: Negotiated<TSocket>,
<Ping as UpgradeInfo>::Info
) -> <Ping as InboundUpgrade<TSocket>>::Future