libp2p::swarm::handler

Trait InboundUpgradeSend

pub trait InboundUpgradeSend: UpgradeInfoSend {
    type Output: Send + 'static;
    type Error: Send + 'static;
    type Future: Future<Output = Result<Self::Output, Self::Error>> + Send + 'static;

    // Required method
    fn upgrade_inbound(self, socket: Stream, info: Self::Info) -> Self::Future;
}
Expand description

Implemented automatically on all types that implement InboundUpgrade and Send + 'static.

Do not implement this trait yourself. Instead, please implement InboundUpgrade.

Required Associated Types§

type Output: Send + 'static

Equivalent to InboundUpgrade::Output.

type Error: Send + 'static

Equivalent to InboundUpgrade::Error.

type Future: Future<Output = Result<Self::Output, Self::Error>> + Send + 'static

Equivalent to InboundUpgrade::Future.

Required Methods§

fn upgrade_inbound(self, socket: Stream, info: Self::Info) -> Self::Future

Implementors§

§

impl<K, H> InboundUpgradeSend for Upgrade<K, H>
where H: InboundUpgradeSend, K: Send + 'static,

§

type Output = (K, <H as InboundUpgradeSend>::Output)

§

type Error = (K, <H as InboundUpgradeSend>::Error)

§

type Future = Pin<Box<dyn Future<Output = Result<<Upgrade<K, H> as InboundUpgradeSend>::Output, <Upgrade<K, H> as InboundUpgradeSend>::Error>> + Send>>

§

impl<T, TInfo> InboundUpgradeSend for T
where T: InboundUpgrade<Stream, Info = TInfo> + UpgradeInfoSend<Info = TInfo>, TInfo: AsRef<str> + Clone + Send + 'static, <T as InboundUpgrade<Stream>>::Output: Send + 'static, <T as InboundUpgrade<Stream>>::Error: Send + 'static, <T as InboundUpgrade<Stream>>::Future: Send + 'static,