Trait libp2p_rs::core::upgrade::Upgrader [−][src]
pub trait Upgrader<C>: UpgradeInfo + Clone { type Output: Send; #[must_use] pub fn upgrade_inbound<'async_trait>(
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + 'async_trait + Send, Global>>
where
Self: 'async_trait; #[must_use] pub fn upgrade_outbound<'async_trait>(
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + 'async_trait + Send, Global>>
where
Self: 'async_trait; }
Common trait for upgrades that can be applied on a connection.
Associated Types
type Output: Send
[src]
Output after the upgrade has been successfully negotiated and the handshake performed.
Required methods
#[must_use]pub fn upgrade_inbound<'async_trait>(
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
[src]
#[must_use]
pub fn upgrade_inbound<'async_trait>(self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
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
.
#[must_use]pub fn upgrade_outbound<'async_trait>(
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
[src]
#[must_use]
pub fn upgrade_outbound<'async_trait>(self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + 'async_trait + Send, Global>> where
Self: 'async_trait,
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<A, B, C> Upgrader<C> for Selector<A, B> where
C: Send + 'static,
B: Upgrader<C> + Send,
A: Upgrader<C> + Send,
[src]
C: Send + 'static,
B: Upgrader<C> + Send,
A: Upgrader<C> + Send,
type Output = EitherOutput<<A as Upgrader<C>>::Output, <B as Upgrader<C>>::Output>
pub fn upgrade_inbound<'async_trait>(
self,
socket: C,
info: <Selector<A, B> as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<EitherOutput<<A as Upgrader<C>>::Output, <B as Upgrader<C>>::Output>, TransportError>> + 'async_trait + Send, Global>> where
Selector<A, B>: 'async_trait,
[src]
self,
socket: C,
info: <Selector<A, B> as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<EitherOutput<<A as Upgrader<C>>::Output, <B as Upgrader<C>>::Output>, TransportError>> + 'async_trait + Send, Global>> where
Selector<A, B>: 'async_trait,
pub fn upgrade_outbound<'async_trait>(
self,
socket: C,
info: <Selector<A, B> as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<EitherOutput<<A as Upgrader<C>>::Output, <B as Upgrader<C>>::Output>, TransportError>> + 'async_trait + Send, Global>> where
Selector<A, B>: 'async_trait,
[src]
self,
socket: C,
info: <Selector<A, B> as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<EitherOutput<<A as Upgrader<C>>::Output, <B as Upgrader<C>>::Output>, TransportError>> + 'async_trait + Send, Global>> where
Selector<A, B>: 'async_trait,
impl<C> Upgrader<C> for libp2p_rs::yamux::Config where
C: ConnectionInfo + SecureInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]
C: ConnectionInfo + SecureInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
type Output = Yamux<C>
pub fn upgrade_inbound<'async_trait>(
self,
socket: C,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<C>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
[src]
self,
socket: C,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<C>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
pub fn upgrade_outbound<'async_trait>(
self,
socket: C,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<C>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
[src]
self,
socket: C,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<C>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
impl<T> Upgrader<T> for libp2p_rs::mplex::Config where
T: ConnectionInfo + SecureInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]
T: ConnectionInfo + SecureInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
type Output = Mplex<T>
pub fn upgrade_inbound<'async_trait>(
self,
socket: T,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
[src]
self,
socket: T,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
pub fn upgrade_outbound<'async_trait>(
self,
socket: T,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
[src]
self,
socket: T,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
impl<T> Upgrader<T> for PlainTextConfig where
T: ConnectionInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]
T: ConnectionInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
type Output = PlainTextOutput<T>
pub fn upgrade_inbound<'async_trait>(
self,
socket: T,
_info: <PlainTextConfig as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<PlainTextConfig as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
PlainTextConfig: 'async_trait,
[src]
self,
socket: T,
_info: <PlainTextConfig as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<PlainTextConfig as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
PlainTextConfig: 'async_trait,
pub fn upgrade_outbound<'async_trait>(
self,
socket: T,
_info: <PlainTextConfig as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<PlainTextConfig as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
PlainTextConfig: 'async_trait,
[src]
self,
socket: T,
_info: <PlainTextConfig as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<PlainTextConfig as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
PlainTextConfig: 'async_trait,
impl<T> Upgrader<T> for libp2p_rs::secio::Config where
T: ConnectionInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
[src]
T: ConnectionInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
type Output = SecioOutput<T>
pub fn upgrade_inbound<'async_trait>(
self,
socket: T,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
[src]
self,
socket: T,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
pub fn upgrade_outbound<'async_trait>(
self,
socket: T,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
[src]
self,
socket: T,
_info: <Config as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<Config as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
Config: 'async_trait,
impl<T> Upgrader<T> for DummyUpgrader where
T: 'static + Send,
[src]
T: 'static + Send,
type Output = DummyStream<T>
pub fn upgrade_inbound<'async_trait>(
self,
socket: T,
_info: <DummyUpgrader as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<DummyUpgrader as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
DummyUpgrader: 'async_trait,
[src]
self,
socket: T,
_info: <DummyUpgrader as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<DummyUpgrader as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
DummyUpgrader: 'async_trait,
pub fn upgrade_outbound<'async_trait>(
self,
socket: T,
_info: <DummyUpgrader as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<DummyUpgrader as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
DummyUpgrader: 'async_trait,
[src]
self,
socket: T,
_info: <DummyUpgrader as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<DummyUpgrader as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
DummyUpgrader: 'async_trait,
impl<T, C> Upgrader<T> for NoiseConfig<XX, C, ()> where
C: Protocol<C> + AsRef<[u8]> + Zeroize + Clone + Send + 'static,
T: ConnectionInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
NoiseConfig<XX, C, ()>: UpgradeInfo,
[src]
C: Protocol<C> + AsRef<[u8]> + Zeroize + Clone + Send + 'static,
T: ConnectionInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static,
NoiseConfig<XX, C, ()>: UpgradeInfo,
type Output = NoiseStream<T>
pub fn upgrade_inbound<'async_trait>(
self,
socket: T,
_info: <NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<NoiseConfig<XX, C, ()> as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
NoiseConfig<XX, C, ()>: 'async_trait,
[src]
self,
socket: T,
_info: <NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<NoiseConfig<XX, C, ()> as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
NoiseConfig<XX, C, ()>: 'async_trait,
pub fn upgrade_outbound<'async_trait>(
self,
socket: T,
_info: <NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<NoiseConfig<XX, C, ()> as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
NoiseConfig<XX, C, ()>: 'async_trait,
[src]
self,
socket: T,
_info: <NoiseConfig<XX, C, ()> as UpgradeInfo>::Info
) -> Pin<Box<dyn Future<Output = Result<<NoiseConfig<XX, C, ()> as Upgrader<T>>::Output, TransportError>> + 'async_trait + Send, Global>> where
NoiseConfig<XX, C, ()>: 'async_trait,