[−][src]Trait libp2prs_core::upgrade::Upgrader
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]fn upgrade_inbound<'async_trait>(
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>> 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]fn upgrade_outbound<'async_trait>(
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>> 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
A: Upgrader<C> + Send,
B: Upgrader<C> + Send,
C: Send + 'static,
[src]
A: Upgrader<C> + Send,
B: Upgrader<C> + Send,
C: Send + 'static,
type Output = EitherOutput<A::Output, B::Output>
fn upgrade_inbound<'async_trait>(
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<EitherOutput<A::Output, B::Output>, TransportError>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<EitherOutput<A::Output, B::Output>, TransportError>> + Send + 'async_trait>> where
Self: 'async_trait,
fn upgrade_outbound<'async_trait>(
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<EitherOutput<A::Output, B::Output>, TransportError>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self,
socket: C,
info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<EitherOutput<A::Output, B::Output>, TransportError>> + Send + 'async_trait>> where
Self: 'async_trait,
impl<T: Send + 'static> Upgrader<T> for DummyUpgrader
[src]
type Output = DummyStream<T>
fn upgrade_inbound<'async_trait>(
self,
socket: T,
_info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self,
socket: T,
_info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>> where
Self: 'async_trait,
fn upgrade_outbound<'async_trait>(
self,
socket: T,
_info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self,
socket: T,
_info: Self::Info
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>> where
Self: 'async_trait,