Trait libp2p::OutboundUpgrade [−][src]
Possible upgrade on an outbound 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_outbound(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 OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for Ping
[src]
type Output = Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>
type Error = Void
type Future = Ready<Result<<Ping as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output, <Ping as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>>
pub fn upgrade_outbound(
self,
stream: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
<Ping as UpgradeInfo>::Info
) -> <Ping as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
[src]
self,
stream: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
<Ping as UpgradeInfo>::Info
) -> <Ping as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
impl<C> OutboundUpgrade<C> for DeniedUpgrade
[src]
type Output = Void
type Error = Void
type Future = Pending<Result<<DeniedUpgrade as OutboundUpgrade<C>>::Output, <DeniedUpgrade as OutboundUpgrade<C>>::Error>>
pub fn upgrade_outbound(
self,
C,
<DeniedUpgrade as UpgradeInfo>::Info
) -> <DeniedUpgrade as OutboundUpgrade<C>>::Future
[src]
self,
C,
<DeniedUpgrade as UpgradeInfo>::Info
) -> <DeniedUpgrade as OutboundUpgrade<C>>::Future
impl<C> OutboundUpgrade<C> for DeflateConfig where
C: AsyncRead + AsyncWrite,
[src]
C: AsyncRead + AsyncWrite,
type Output = DeflateOutput<C>
type Error = Error
type Future = Ready<Result<<DeflateConfig as OutboundUpgrade<C>>::Output, <DeflateConfig as OutboundUpgrade<C>>::Error>>
pub fn upgrade_outbound(
self,
w: C,
<DeflateConfig as UpgradeInfo>::Info
) -> <DeflateConfig as OutboundUpgrade<C>>::Future
[src]
self,
w: C,
<DeflateConfig as UpgradeInfo>::Info
) -> <DeflateConfig as OutboundUpgrade<C>>::Future
impl<C> OutboundUpgrade<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>>, KadRequestMsg, Ready<Result<Cursor<Vec<u8, Global>>, Error>>, fn(KadRequestMsg) -> Ready<Result<Cursor<Vec<u8, Global>>, Error>>>, Ready<Result<KadResponseMsg, Error>>, fn(BytesMut) -> Ready<Result<KadResponseMsg, Error>>>
type Future = Ready<Result<<KademliaProtocolConfig as OutboundUpgrade<C>>::Output, Error>>
type Error = Error
pub fn upgrade_outbound(
self,
incoming: C,
<KademliaProtocolConfig as UpgradeInfo>::Info
) -> <KademliaProtocolConfig as OutboundUpgrade<C>>::Future
[src]
self,
incoming: C,
<KademliaProtocolConfig as UpgradeInfo>::Info
) -> <KademliaProtocolConfig as OutboundUpgrade<C>>::Future
impl<C> OutboundUpgrade<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 OutboundUpgrade<C>>::Output, Error>>
pub fn upgrade_outbound(
self,
socket: C,
<MplexConfig as UpgradeInfo>::Info
) -> <MplexConfig as OutboundUpgrade<C>>::Future
[src]
self,
socket: C,
<MplexConfig as UpgradeInfo>::Info
) -> <MplexConfig as OutboundUpgrade<C>>::Future
impl<C> OutboundUpgrade<C> for PlainText1Config
[src]
type Output = C
type Error = Void
type Future = Ready<Result<C, <PlainText1Config as OutboundUpgrade<C>>::Error>>
pub fn upgrade_outbound(
self,
i: C,
<PlainText1Config as UpgradeInfo>::Info
) -> <PlainText1Config as OutboundUpgrade<C>>::Future
[src]
self,
i: C,
<PlainText1Config as UpgradeInfo>::Info
) -> <PlainText1Config as OutboundUpgrade<C>>::Future
impl<C> OutboundUpgrade<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 OutboundUpgrade<C>>::Output, <PlainText2Config as OutboundUpgrade<C>>::Error>> + 'static + Send, Global>>
pub fn upgrade_outbound(
self,
socket: C,
<PlainText2Config as UpgradeInfo>::Info
) -> <PlainText2Config as OutboundUpgrade<C>>::Future
[src]
self,
socket: C,
<PlainText2Config as UpgradeInfo>::Info
) -> <PlainText2Config as OutboundUpgrade<C>>::Future
impl<C> OutboundUpgrade<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 OutboundUpgrade<C>>::Output, <Config as OutboundUpgrade<C>>::Error>>
pub fn upgrade_outbound(
self,
io: C,
<Config as UpgradeInfo>::Info
) -> <Config as OutboundUpgrade<C>>::Future
[src]
self,
io: C,
<Config as UpgradeInfo>::Info
) -> <Config as OutboundUpgrade<C>>::Future
impl<C> OutboundUpgrade<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 OutboundUpgrade<C>>::Output, <LocalConfig as OutboundUpgrade<C>>::Error>>
pub fn upgrade_outbound(
self,
io: C,
<LocalConfig as UpgradeInfo>::Info
) -> <LocalConfig as OutboundUpgrade<C>>::Future
[src]
self,
io: C,
<LocalConfig as UpgradeInfo>::Info
) -> <LocalConfig as OutboundUpgrade<C>>::Future
impl<C, A, B, TA, TB, EA, EB> OutboundUpgrade<C> for EitherUpgrade<A, B> where
A: OutboundUpgrade<C, Output = TA, Error = EA>,
B: OutboundUpgrade<C, Output = TB, Error = EB>,
[src]
A: OutboundUpgrade<C, Output = TA, Error = EA>,
B: OutboundUpgrade<C, Output = TB, Error = EB>,
type Output = EitherOutput<TA, TB>
type Error = EitherError<EA, EB>
type Future = EitherFuture2<<A as OutboundUpgrade<C>>::Future, <B as OutboundUpgrade<C>>::Future>
pub fn upgrade_outbound(
self,
sock: C,
info: <EitherUpgrade<A, B> as UpgradeInfo>::Info
) -> <EitherUpgrade<A, B> as OutboundUpgrade<C>>::Future
[src]
self,
sock: C,
info: <EitherUpgrade<A, B> as UpgradeInfo>::Info
) -> <EitherUpgrade<A, B> as OutboundUpgrade<C>>::Future
impl<C, A, B, TA, TB, EA, EB> OutboundUpgrade<C> for SelectUpgrade<A, B> where
A: OutboundUpgrade<C, Output = TA, Error = EA>,
B: OutboundUpgrade<C, Output = TB, Error = EB>,
[src]
A: OutboundUpgrade<C, Output = TA, Error = EA>,
B: OutboundUpgrade<C, Output = TB, Error = EB>,
type Output = EitherOutput<TA, TB>
type Error = EitherError<EA, EB>
type Future = EitherFuture2<<A as OutboundUpgrade<C>>::Future, <B as OutboundUpgrade<C>>::Future>
pub fn upgrade_outbound(
self,
sock: C,
info: <SelectUpgrade<A, B> as UpgradeInfo>::Info
) -> <SelectUpgrade<A, B> as OutboundUpgrade<C>>::Future
[src]
self,
sock: C,
info: <SelectUpgrade<A, B> as UpgradeInfo>::Info
) -> <SelectUpgrade<A, B> as OutboundUpgrade<C>>::Future
impl<C, F, O, A, E> OutboundUpgrade<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_outbound(self, socket: C, _: Self::Info) -> Self::Future
[src]
impl<C, P, F, Fut, Err, Out> OutboundUpgrade<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_outbound(
self,
sock: C,
<FromFnUpgrade<P, F> as UpgradeInfo>::Info
) -> <FromFnUpgrade<P, F> as OutboundUpgrade<C>>::Future
[src]
self,
sock: C,
<FromFnUpgrade<P, F> as UpgradeInfo>::Info
) -> <FromFnUpgrade<P, F> as OutboundUpgrade<C>>::Future
impl<C, T> OutboundUpgrade<C> for OptionalUpgrade<T> where
T: OutboundUpgrade<C>,
[src]
T: OutboundUpgrade<C>,
type Output = <T as OutboundUpgrade<C>>::Output
type Error = <T as OutboundUpgrade<C>>::Error
type Future = <T as OutboundUpgrade<C>>::Future
pub fn upgrade_outbound(
self,
sock: C,
info: <OptionalUpgrade<T> as UpgradeInfo>::Info
) -> <OptionalUpgrade<T> as OutboundUpgrade<C>>::Future
[src]
self,
sock: C,
info: <OptionalUpgrade<T> as UpgradeInfo>::Info
) -> <OptionalUpgrade<T> as OutboundUpgrade<C>>::Future
impl<C, U, F> OutboundUpgrade<C> for MapInboundUpgrade<U, F> where
U: OutboundUpgrade<C>,
[src]
U: OutboundUpgrade<C>,
type Output = <U as OutboundUpgrade<C>>::Output
type Error = <U as OutboundUpgrade<C>>::Error
type Future = <U as OutboundUpgrade<C>>::Future
pub fn upgrade_outbound(
self,
sock: C,
info: <MapInboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgrade<U, F> as OutboundUpgrade<C>>::Future
[src]
self,
sock: C,
info: <MapInboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgrade<U, F> as OutboundUpgrade<C>>::Future
impl<C, U, F> OutboundUpgrade<C> for MapInboundUpgradeErr<U, F> where
U: OutboundUpgrade<C>,
[src]
U: OutboundUpgrade<C>,
type Output = <U as OutboundUpgrade<C>>::Output
type Error = <U as OutboundUpgrade<C>>::Error
type Future = <U as OutboundUpgrade<C>>::Future
pub fn upgrade_outbound(
self,
sock: C,
info: <MapInboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgradeErr<U, F> as OutboundUpgrade<C>>::Future
[src]
self,
sock: C,
info: <MapInboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapInboundUpgradeErr<U, F> as OutboundUpgrade<C>>::Future
impl<C, U, F, T> OutboundUpgrade<C> for MapOutboundUpgrade<U, F> where
F: FnOnce(<U as OutboundUpgrade<C>>::Output) -> T,
U: OutboundUpgrade<C>,
[src]
F: FnOnce(<U as OutboundUpgrade<C>>::Output) -> T,
U: OutboundUpgrade<C>,
type Output = T
type Error = <U as OutboundUpgrade<C>>::Error
type Future = MapFuture<<U as OutboundUpgrade<C>>::Future, F>
pub fn upgrade_outbound(
self,
sock: C,
info: <MapOutboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapOutboundUpgrade<U, F> as OutboundUpgrade<C>>::Future
[src]
self,
sock: C,
info: <MapOutboundUpgrade<U, F> as UpgradeInfo>::Info
) -> <MapOutboundUpgrade<U, F> as OutboundUpgrade<C>>::Future
impl<C, U, F, T> OutboundUpgrade<C> for MapOutboundUpgradeErr<U, F> where
F: FnOnce(<U as OutboundUpgrade<C>>::Error) -> T,
U: OutboundUpgrade<C>,
[src]
F: FnOnce(<U as OutboundUpgrade<C>>::Error) -> T,
U: OutboundUpgrade<C>,
type Output = <U as OutboundUpgrade<C>>::Output
type Error = T
type Future = MapErrFuture<<U as OutboundUpgrade<C>>::Future, F>
pub fn upgrade_outbound(
self,
sock: C,
info: <MapOutboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapOutboundUpgradeErr<U, F> as OutboundUpgrade<C>>::Future
[src]
self,
sock: C,
info: <MapOutboundUpgradeErr<U, F> as UpgradeInfo>::Info
) -> <MapOutboundUpgradeErr<U, F> as OutboundUpgrade<C>>::Future
impl<T, C> OutboundUpgrade<T> for NoiseConfig<IK, C, (PublicKey<C>, PublicKey)> where
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
NoiseConfig<IK, C, (PublicKey<C>, PublicKey)>: UpgradeInfo,
[src]
C: Protocol<C> + AsRef<[u8]> + Zeroize + Send + 'static,
T: AsyncRead + AsyncWrite + Unpin + Send + 'static,
NoiseConfig<IK, C, (PublicKey<C>, PublicKey)>: UpgradeInfo,
type Output = (RemoteIdentity<C>, NoiseOutput<T>)
type Error = NoiseError
type Future = Handshake<T, C>
pub fn upgrade_outbound(
self,
socket: T,
<NoiseConfig<IK, C, (PublicKey<C>, PublicKey)> as UpgradeInfo>::Info
) -> <NoiseConfig<IK, C, (PublicKey<C>, PublicKey)> as OutboundUpgrade<T>>::Future
[src]
self,
socket: T,
<NoiseConfig<IK, C, (PublicKey<C>, PublicKey)> as UpgradeInfo>::Info
) -> <NoiseConfig<IK, C, (PublicKey<C>, PublicKey)> as OutboundUpgrade<T>>::Future
impl<T, C> OutboundUpgrade<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_outbound(
self,
socket: T,
<NoiseConfig<IX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<IX, C, ()> as OutboundUpgrade<T>>::Future
[src]
self,
socket: T,
<NoiseConfig<IX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<IX, C, ()> as OutboundUpgrade<T>>::Future
impl<T, C> OutboundUpgrade<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_outbound(
self,
socket: T,
<NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<XX, C, ()> as OutboundUpgrade<T>>::Future
[src]
self,
socket: T,
<NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> <NoiseConfig<XX, C, ()> as OutboundUpgrade<T>>::Future
impl<T, P, C, R> OutboundUpgrade<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>: OutboundUpgrade<T>,
NoiseConfig<P, C, R>: 'static,
<NoiseConfig<P, C, R> as OutboundUpgrade<T>>::Future: Send,
<NoiseConfig<P, C, R> as OutboundUpgrade<T>>::Output == (RemoteIdentity<C>, NoiseOutput<T>),
<NoiseConfig<P, C, R> as OutboundUpgrade<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>: OutboundUpgrade<T>,
NoiseConfig<P, C, R>: 'static,
<NoiseConfig<P, C, R> as OutboundUpgrade<T>>::Future: Send,
<NoiseConfig<P, C, R> as OutboundUpgrade<T>>::Output == (RemoteIdentity<C>, NoiseOutput<T>),
<NoiseConfig<P, C, R> as OutboundUpgrade<T>>::Error == NoiseError,
type Output = (PeerId, NoiseOutput<T>)
type Error = NoiseError
type Future = Pin<Box<dyn Future<Output = Result<<NoiseAuthenticated<P, C, R> as OutboundUpgrade<T>>::Output, <NoiseAuthenticated<P, C, R> as OutboundUpgrade<T>>::Error>> + 'static + Send, Global>>
pub fn upgrade_outbound(
self,
socket: T,
info: <NoiseAuthenticated<P, C, R> as UpgradeInfo>::Info
) -> <NoiseAuthenticated<P, C, R> as OutboundUpgrade<T>>::Future
[src]
self,
socket: T,
info: <NoiseAuthenticated<P, C, R> as UpgradeInfo>::Info
) -> <NoiseAuthenticated<P, C, R> as OutboundUpgrade<T>>::Future
impl<TCodec> OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>> for RequestProtocol<TCodec> where
TCodec: RequestResponseCodec + Send + 'static,
[src]
TCodec: RequestResponseCodec + Send + 'static,
type Output = <TCodec as RequestResponseCodec>::Response
type Error = Error
type Future = Pin<Box<dyn Future<Output = Result<<RequestProtocol<TCodec> as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Output, <RequestProtocol<TCodec> as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Error>> + 'static + Send, Global>>
pub fn upgrade_outbound(
self,
io: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
protocol: <RequestProtocol<TCodec> as UpgradeInfo>::Info
) -> <RequestProtocol<TCodec> as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
[src]
self,
io: Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>,
protocol: <RequestProtocol<TCodec> as UpgradeInfo>::Info
) -> <RequestProtocol<TCodec> as OutboundUpgrade<Negotiated<SubstreamRef<Arc<StreamMuxerBox>>>>>::Future
impl<TSocket> OutboundUpgrade<TSocket> for FloodsubRpc where
TSocket: AsyncWrite + AsyncRead + Send + Unpin + 'static,
[src]
TSocket: AsyncWrite + AsyncRead + Send + Unpin + 'static,
type Output = ()
type Error = Error
type Future = Pin<Box<dyn Future<Output = Result<<FloodsubRpc as OutboundUpgrade<TSocket>>::Output, <FloodsubRpc as OutboundUpgrade<TSocket>>::Error>> + 'static + Send, Global>>
pub fn upgrade_outbound(
self,
socket: TSocket,
<FloodsubRpc as UpgradeInfo>::Info
) -> <FloodsubRpc as OutboundUpgrade<TSocket>>::Future
[src]
self,
socket: TSocket,
<FloodsubRpc as UpgradeInfo>::Info
) -> <FloodsubRpc as OutboundUpgrade<TSocket>>::Future
impl<TSocket> OutboundUpgrade<TSocket> for ProtocolConfig where
TSocket: AsyncWrite + AsyncRead + Unpin + Send + 'static,
[src]
TSocket: AsyncWrite + AsyncRead + Unpin + Send + 'static,
type Output = Framed<TSocket, GossipsubCodec>
type Error = Error
type Future = Pin<Box<dyn Future<Output = Result<<ProtocolConfig as OutboundUpgrade<TSocket>>::Output, <ProtocolConfig as OutboundUpgrade<TSocket>>::Error>> + 'static + Send, Global>>
pub fn upgrade_outbound(
self,
socket: TSocket,
<ProtocolConfig as UpgradeInfo>::Info
) -> <ProtocolConfig as OutboundUpgrade<TSocket>>::Future
[src]
self,
socket: TSocket,
<ProtocolConfig as UpgradeInfo>::Info
) -> <ProtocolConfig as OutboundUpgrade<TSocket>>::Future