Trait libp2prs_core::upgrade::Upgrader[][src]

pub trait Upgrader<C>: UpgradeInfo + Clone {
    type Output: Send;
    #[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
;
#[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
; }

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.

Loading content...

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]

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]

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.

Loading content...

Implementors

impl<A, B, C> Upgrader<C> for Selector<A, B> where
    A: Upgrader<C> + Send,
    B: Upgrader<C> + Send,
    C: Send + 'static, 
[src]

type Output = EitherOutput<A::Output, B::Output>

impl<T: Send + 'static> Upgrader<T> for DummyUpgrader[src]

type Output = DummyStream<T>

Loading content...