Trait libp2p_core::upgrade::UpgradeInfo

source ·
pub trait UpgradeInfo {
    type Info: AsRef<str> + Clone;
    type InfoIter: IntoIterator<Item = Self::Info>;

    // Required method
    fn protocol_info(&self) -> Self::InfoIter;
}
Expand description

Common trait for upgrades that can be applied on inbound substreams, outbound substreams, or both.

Required Associated Types§

source

type Info: AsRef<str> + Clone

Opaque type representing a negotiable protocol.

source

type InfoIter: IntoIterator<Item = Self::Info>

Iterator returned by protocol_info.

Required Methods§

source

fn protocol_info(&self) -> Self::InfoIter

Returns the list of protocols that are supported. Used during the negotiation process.

Implementations on Foreign Types§

source§

impl<A, B> UpgradeInfo for Either<A, B>
where A: UpgradeInfo, B: UpgradeInfo,

§

type Info = Either<<A as UpgradeInfo>::Info, <B as UpgradeInfo>::Info>

§

type InfoIter = Either<Map<<<A as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter, fn(_: <A as UpgradeInfo>::Info) -> <Either<A, B> as UpgradeInfo>::Info>, Map<<<B as UpgradeInfo>::InfoIter as IntoIterator>::IntoIter, fn(_: <B as UpgradeInfo>::Info) -> <Either<A, B> as UpgradeInfo>::Info>>

source§

fn protocol_info(&self) -> Self::InfoIter

Implementors§