Trait Upgrade

Source
pub trait Upgrade<S>: UpgradeInfo {
    type Output;
    type Error;
    type Future: Future<Output = Result<Self::Output, Self::Error>>;

    // Required methods
    fn upgrade_inbound(self, stream: S, info: Self::Info) -> Self::Future;
    fn upgrade_outbound(self, stream: S, info: Self::Info) -> Self::Future;
}
Expand description

流升级

Required Associated Types§

Source

type Output

Source

type Error

Source

type Future: Future<Output = Result<Self::Output, Self::Error>>

Required Methods§

Source

fn upgrade_inbound(self, stream: S, info: Self::Info) -> Self::Future

升级入站流

Source

fn upgrade_outbound(self, stream: S, info: Self::Info) -> Self::Future

升级出站流

Implementations on Foreign Types§

Source§

impl<C, A, B, TA, TB, EA, EB> Upgrade<C> for Either<A, B>
where A: Upgrade<C, Output = TA, Error = EA>, B: Upgrade<C, Output = TB, Error = EB>,

Source§

type Output = Either<TA, TB>

Source§

type Error = Either<EA, EB>

Source§

type Future = EitherFuture<<A as Upgrade<C>>::Future, <B as Upgrade<C>>::Future>

Source§

fn upgrade_inbound(self, stream: C, info: Self::Info) -> Self::Future

Source§

fn upgrade_outbound(self, stream: C, info: Self::Info) -> Self::Future

Implementors§

Source§

impl<C, A, B, TA, TB, EA, EB> Upgrade<C> for SelectUpgrade<A, B>
where A: Upgrade<C, Output = TA, Error = EA>, B: Upgrade<C, Output = TB, Error = EB>,

Source§

type Output = Either<TA, TB>

Source§

type Error = Either<EA, EB>

Source§

type Future = EitherFuture<<A as Upgrade<C>>::Future, <B as Upgrade<C>>::Future>

Source§

impl<C, P> Upgrade<C> for PendingUpgrade<P>
where P: AsRef<str> + Clone,

Source§

impl<C, P> Upgrade<C> for ReadyUpgrade<P>
where P: AsRef<str> + Clone,