Trait libp2p::InboundUpgrade [−][src]
pub trait InboundUpgrade<C>: UpgradeInfo { type Output; type Error; type Future: Future; fn upgrade_inbound(self, socket: C, info: Self::Info) -> Self::Future; }
Expand description
Possible upgrade on an inbound connection or substream.
Associated Types
Output after the upgrade has been successfully negotiated and the handshake performed.
Required methods
fn upgrade_inbound(self, socket: C, info: Self::Info) -> Self::Future
[src]
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
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]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]type Output = DeflateOutput<C>
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]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>>
pub fn upgrade_inbound(
self,
incoming: C,
<KademliaProtocolConfig as UpgradeInfo>::Info
) -> <KademliaProtocolConfig as InboundUpgrade<C>>::Future
[src]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]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]impl<C> InboundUpgrade<C> for PlainText2Config where
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]
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>>
pub fn upgrade_inbound(
self,
socket: C,
<PlainText2Config as UpgradeInfo>::Info
) -> <PlainText2Config as InboundUpgrade<C>>::Future
[src]impl<C> InboundUpgrade<C> for YamuxConfig where
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]
impl<C> InboundUpgrade<C> for YamuxConfig where
C: AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]type Future = Ready<Result<<YamuxConfig as InboundUpgrade<C>>::Output, <YamuxConfig as InboundUpgrade<C>>::Error>>
pub fn upgrade_inbound(
self,
io: C,
<YamuxConfig as UpgradeInfo>::Info
) -> <YamuxConfig as InboundUpgrade<C>>::Future
[src]impl<C> InboundUpgrade<C> for YamuxLocalConfig where
C: AsyncRead + AsyncWrite + Unpin + 'static,
[src]
impl<C> InboundUpgrade<C> for YamuxLocalConfig where
C: AsyncRead + AsyncWrite + Unpin + 'static,
[src]type Output = Yamux<LocalIncoming<C>>
type Future = Ready<Result<<YamuxLocalConfig as InboundUpgrade<C>>::Output, <YamuxLocalConfig as InboundUpgrade<C>>::Error>>
pub fn upgrade_inbound(
self,
io: C,
<YamuxLocalConfig as UpgradeInfo>::Info
) -> <YamuxLocalConfig as InboundUpgrade<C>>::Future
[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]
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>
pub fn upgrade_inbound(
self,
sock: C,
info: <EitherUpgrade<A, B> as UpgradeInfo>::Info
) -> <EitherUpgrade<A, B> as InboundUpgrade<C>>::Future
[src]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]
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>
pub fn upgrade_inbound(
self,
sock: C,
info: <SelectUpgrade<A, B> as UpgradeInfo>::Info
) -> <SelectUpgrade<A, B> as InboundUpgrade<C>>::Future
[src]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]
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]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]
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
pub fn upgrade_inbound(
self,
sock: C,
<FromFnUpgrade<P, F> as UpgradeInfo>::Info
) -> <FromFnUpgrade<P, F> as InboundUpgrade<C>>::Future
[src]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]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]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]impl<C, U, F, T> InboundUpgrade<C> for MapInboundUpgrade<U, F> where
F: FnOnce(<U as InboundUpgrade<C>>::Output) -> T,
U: InboundUpgrade<C>,
[src]
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>
pub fn upgrade_inbound(
self,
sock: C,
info: <MapInboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgrade<U, F> as InboundUpgrade<C>>::Future
[src]impl<C, U, F, T> InboundUpgrade<C> for MapInboundUpgradeErr<U, F> where
F: FnOnce(<U as InboundUpgrade<C>>::Error) -> T,
U: InboundUpgrade<C>,
[src]
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>
pub fn upgrade_inbound(
self,
sock: C,
info: <MapInboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgradeErr<U, F> as InboundUpgrade<C>>::Future
[src]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]
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
pub fn upgrade_inbound(
self,
socket: T,
<NoiseConfig<IX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<IX, C, ()> as InboundUpgrade<T>>::Future
[src]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]
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
pub fn upgrade_inbound(
self,
socket: T,
<NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<XX, C, ()> as InboundUpgrade<T>>::Future
[src]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]
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
pub fn upgrade_inbound(
self,
socket: T,
<NoiseConfig<IK, C, R> as UpgradeInfo>::Info
) -> <NoiseConfig<IK, C, R> as InboundUpgrade<T>>::Future
[src]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]
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>>
pub fn upgrade_inbound(
self,
socket: T,
info: <NoiseAuthenticated<P, C, R> as UpgradeInfo>::Info
) -> <NoiseAuthenticated<P, C, R> as InboundUpgrade<T>>::Future
[src]impl<TCodec> InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for ResponseProtocol<TCodec> where
TCodec: RequestResponseCodec + Send + 'static,
[src]
impl<TCodec> InboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for ResponseProtocol<TCodec> where
TCodec: RequestResponseCodec + Send + 'static,
[src]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]impl<TSocket> InboundUpgrade<TSocket> for FloodsubProtocol where
TSocket: AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]
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>>
pub fn upgrade_inbound(
self,
socket: TSocket,
<FloodsubProtocol as UpgradeInfo>::Info
) -> <FloodsubProtocol as InboundUpgrade<TSocket>>::Future
[src]impl<TSocket> InboundUpgrade<TSocket> for ProtocolConfig where
TSocket: AsyncRead + AsyncWrite + Unpin + Send + 'static,
[src]
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>>
pub fn upgrade_inbound(
self,
socket: TSocket,
protocol_id: <ProtocolConfig as UpgradeInfo>::Info
) -> <ProtocolConfig as InboundUpgrade<TSocket>>::Future
[src]