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.

Loading content...

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]

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]

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
    C: Send + 'static,
    B: Upgrader<C> + Send,
    A: Upgrader<C> + Send
[src]

type Output = EitherOutput<<A as Upgrader<C>>::Output, <B as Upgrader<C>>::Output>

impl<C> Upgrader<C> for libp2p_rs::yamux::Config where
    C: ConnectionInfo + SecureInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static, 
[src]

type Output = Yamux<C>

impl<T> Upgrader<T> for libp2p_rs::mplex::Config where
    T: ConnectionInfo + SecureInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static, 
[src]

type Output = Mplex<T>

impl<T> Upgrader<T> for PlainTextConfig where
    T: ConnectionInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static, 
[src]

type Output = PlainTextOutput<T>

impl<T> Upgrader<T> for libp2p_rs::secio::Config where
    T: ConnectionInfo + AsyncRead + AsyncWrite + Send + Unpin + 'static, 
[src]

type Output = SecioOutput<T>

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

type Output = DummyStream<T>

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]

type Output = NoiseStream<T>

Loading content...