Trait libp2p::core::upgrade::InboundUpgrade [−][src]
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.
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
.
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>>
pub fn upgrade_inbound(
self,
stream: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
<Ping as UpgradeInfo>::Info
) -> <Ping as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
[src]
self,
stream: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
<Ping as UpgradeInfo>::Info
) -> <Ping as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
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>>
pub fn upgrade_inbound(
self,
C,
<DeniedUpgrade as UpgradeInfo>::Info
) -> <DeniedUpgrade as InboundUpgrade<C>>::Future
[src]
self,
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 = DeflateOutput<C>
type Error = Error
type Future = Ready<Result<<DeflateConfig as InboundUpgrade<C>>::Output, <DeflateConfig as InboundUpgrade<C>>::Error>>
pub fn upgrade_inbound(
self,
r: C,
<DeflateConfig as UpgradeInfo>::Info
) -> <DeflateConfig as InboundUpgrade<C>>::Future
[src]
self,
r: C,
<DeflateConfig as UpgradeInfo>::Info
) -> <DeflateConfig as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for KademliaProtocolConfig where
C: AsyncRead + AsyncWrite + Unpin,
[src]
C: AsyncRead + AsyncWrite + Unpin,
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
pub fn upgrade_inbound(
self,
incoming: C,
<KademliaProtocolConfig as UpgradeInfo>::Info
) -> <KademliaProtocolConfig as InboundUpgrade<C>>::Future
[src]
self,
incoming: C,
<KademliaProtocolConfig as UpgradeInfo>::Info
) -> <KademliaProtocolConfig as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for MplexConfig where
C: AsyncRead + AsyncWrite + Unpin,
[src]
C: AsyncRead + AsyncWrite + Unpin,
type Output = Multiplex<C>
type Error = Error
type Future = Ready<Result<<MplexConfig as InboundUpgrade<C>>::Output, Error>>
pub fn upgrade_inbound(
self,
socket: C,
<MplexConfig as UpgradeInfo>::Info
) -> <MplexConfig as InboundUpgrade<C>>::Future
[src]
self,
socket: C,
<MplexConfig as UpgradeInfo>::Info
) -> <MplexConfig as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for PlainText1Config
[src]
type Output = C
type Error = Void
type Future = Ready<Result<C, <PlainText1Config as InboundUpgrade<C>>::Error>>
pub fn upgrade_inbound(
self,
i: C,
<PlainText1Config as UpgradeInfo>::Info
) -> <PlainText1Config as InboundUpgrade<C>>::Future
[src]
self,
i: C,
<PlainText1Config as UpgradeInfo>::Info
) -> <PlainText1Config as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for PlainText2Config where
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
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>>
pub fn upgrade_inbound(
self,
socket: C,
<PlainText2Config as UpgradeInfo>::Info
) -> <PlainText2Config as InboundUpgrade<C>>::Future
[src]
self,
socket: C,
<PlainText2Config as UpgradeInfo>::Info
) -> <PlainText2Config as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for Config where
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
type Output = Yamux<Incoming<C>>
type Error = Error
type Future = Ready<Result<<Config as InboundUpgrade<C>>::Output, <Config as InboundUpgrade<C>>::Error>>
pub fn upgrade_inbound(
self,
io: C,
<Config as UpgradeInfo>::Info
) -> <Config as InboundUpgrade<C>>::Future
[src]
self,
io: C,
<Config as UpgradeInfo>::Info
) -> <Config as InboundUpgrade<C>>::Future
impl<C> InboundUpgrade<C> for LocalConfig where
C: AsyncRead + AsyncWrite + Unpin + 'static,
[src]
C: AsyncRead + AsyncWrite + Unpin + 'static,
type Output = Yamux<LocalIncoming<C>>
type Error = Error
type Future = Ready<Result<<LocalConfig as InboundUpgrade<C>>::Output, <LocalConfig as InboundUpgrade<C>>::Error>>
pub fn upgrade_inbound(
self,
io: C,
<LocalConfig as UpgradeInfo>::Info
) -> <LocalConfig as InboundUpgrade<C>>::Future
[src]
self,
io: C,
<LocalConfig as UpgradeInfo>::Info
) -> <LocalConfig 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>
pub fn upgrade_inbound(
self,
sock: C,
info: <EitherUpgrade<A, B> as UpgradeInfo>::Info
) -> <EitherUpgrade<A, B> as InboundUpgrade<C>>::Future
[src]
self,
sock: 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>
pub fn upgrade_inbound(
self,
sock: C,
info: <SelectUpgrade<A, B> as UpgradeInfo>::Info
) -> <SelectUpgrade<A, B> as InboundUpgrade<C>>::Future
[src]
self,
sock: C,
info: <SelectUpgrade<A, B> as UpgradeInfo>::Info
) -> <SelectUpgrade<A, 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]
C: AsyncRead + AsyncWrite,
F: Fn(C) -> O,
O: Future<Output = Result<A, E>>,
type Output = A
type Error = E
type Future = O
fn upgrade_inbound(self, socket: C, _: Self::Info) -> Self::Future
[src]
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]
F: FnOnce(C, Endpoint) -> Fut,
P: ProtocolName + Clone,
Fut: Future<Output = Result<Out, Err>>,
type Output = Out
type Error = Err
type Future = Fut
pub fn upgrade_inbound(
self,
sock: C,
<FromFnUpgrade<P, F> as UpgradeInfo>::Info
) -> <FromFnUpgrade<P, F> as InboundUpgrade<C>>::Future
[src]
self,
sock: C,
<FromFnUpgrade<P, F> as UpgradeInfo>::Info
) -> <FromFnUpgrade<P, F> as InboundUpgrade<C>>::Future
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
pub fn upgrade_inbound(
self,
sock: C,
info: <OptionalUpgrade<T> as UpgradeInfo>::Info
) -> <OptionalUpgrade<T> as InboundUpgrade<C>>::Future
[src]
self,
sock: 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
pub fn upgrade_inbound(
self,
sock: C,
info: <MapOutboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapOutboundUpgrade<U, F> as InboundUpgrade<C>>::Future
[src]
self,
sock: 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
pub fn upgrade_inbound(
self,
sock: C,
info: <MapOutboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapOutboundUpgradeErr<U, F> as InboundUpgrade<C>>::Future
[src]
self,
sock: 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>
pub fn upgrade_inbound(
self,
sock: C,
info: <MapInboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgrade<U, F> as InboundUpgrade<C>>::Future
[src]
self,
sock: 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>
pub fn upgrade_inbound(
self,
sock: C,
info: <MapInboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgradeErr<U, F> as InboundUpgrade<C>>::Future
[src]
self,
sock: C,
info: <MapInboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgradeErr<U, F> as InboundUpgrade<C>>::Future
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]
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
NoiseConfig<IX, C, ()>: UpgradeInfo,
type Output = (RemoteIdentity<C>, NoiseOutput<T>)
type Error = NoiseError
type Future = Handshake<T, C>
pub fn upgrade_inbound(
self,
socket: T,
<NoiseConfig<IX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<IX, C, ()> as InboundUpgrade<T>>::Future
[src]
self,
socket: 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 + Unpin + Send + 'static,
NoiseConfig<XX, C, ()>: UpgradeInfo,
[src]
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
NoiseConfig<XX, C, ()>: UpgradeInfo,
type Output = (RemoteIdentity<C>, NoiseOutput<T>)
type Error = NoiseError
type Future = Handshake<T, C>
pub fn upgrade_inbound(
self,
socket: T,
<NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<XX, C, ()> as InboundUpgrade<T>>::Future
[src]
self,
socket: T,
<NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<XX, C, ()> as InboundUpgrade<T>>::Future
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]
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
NoiseConfig<IK, C, R>: UpgradeInfo,
type Output = (RemoteIdentity<C>, NoiseOutput<T>)
type Error = NoiseError
type Future = Handshake<T, C>
pub fn upgrade_inbound(
self,
socket: T,
<NoiseConfig<IK, C, R> as UpgradeInfo>::Info
) -> <NoiseConfig<IK, C, R> as InboundUpgrade<T>>::Future
[src]
self,
socket: T,
<NoiseConfig<IK, C, R> as UpgradeInfo>::Info
) -> <NoiseConfig<IK, C, R> 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>: '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]
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,
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>>
pub fn upgrade_inbound(
self,
socket: T,
info: <NoiseAuthenticated<P, C, R> as UpgradeInfo>::Info
) -> <NoiseAuthenticated<P, C, R> as InboundUpgrade<T>>::Future
[src]
self,
socket: T,
info: <NoiseAuthenticated<P, C, R> as UpgradeInfo>::Info
) -> <NoiseAuthenticated<P, C, R> as InboundUpgrade<T>>::Future
impl<TCodec> InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for ResponseProtocol<TCodec> where
TCodec: RequestResponseCodec + Send + 'static,
[src]
TCodec: RequestResponseCodec + Send + 'static,
type Output = ()
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>>
pub fn upgrade_inbound(
self,
io: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
protocol: <ResponseProtocol<TCodec> as UpgradeInfo>::Info
) -> <ResponseProtocol<TCodec> as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
[src]
self,
io: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
protocol: <ResponseProtocol<TCodec> as UpgradeInfo>::Info
) -> <ResponseProtocol<TCodec> as InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
impl<TSocket> InboundUpgrade<TSocket> for FloodsubProtocol where
TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]
TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
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>>
pub fn upgrade_inbound(
self,
socket: TSocket,
<FloodsubProtocol as UpgradeInfo>::Info
) -> <FloodsubProtocol as InboundUpgrade<TSocket>>::Future
[src]
self,
socket: TSocket,
<FloodsubProtocol as UpgradeInfo>::Info
) -> <FloodsubProtocol as InboundUpgrade<TSocket>>::Future
impl<TSocket> InboundUpgrade<TSocket> for ProtocolConfig where
TSocket: AsyncRead + AsyncWrite + Unpin + Send + 'static,
[src]
TSocket: AsyncRead + AsyncWrite + Unpin + Send + 'static,
type Output = Framed<TSocket, GossipsubCodec>
type Error = Error
type Future = Pin<Box<dyn Future<Output = Result<<ProtocolConfig as InboundUpgrade<TSocket>>::Output, <ProtocolConfig as InboundUpgrade<TSocket>>::Error>> + 'static + Send, Global>>
pub fn upgrade_inbound(
self,
socket: TSocket,
<ProtocolConfig as UpgradeInfo>::Info
) -> <ProtocolConfig as InboundUpgrade<TSocket>>::Future
[src]
self,
socket: TSocket,
<ProtocolConfig as UpgradeInfo>::Info
) -> <ProtocolConfig as InboundUpgrade<TSocket>>::Future