OutboundUpgrade

Trait OutboundUpgrade 

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

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

Possible upgrade on an outbound connection or substream.

Required Associated Types§

Source

type Output

Output after the upgrade has been successfully negotiated and the handshake performed.

Source

type Error

Possible error during the handshake.

Source

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

Future that performs the handshake with the remote.

Required Methods§

Source

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

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.

Implementors§

Source§

impl<C> OutboundUpgrade<C> for DeniedUpgrade

Source§

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

Source§

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

Source§

impl<C, P, F, Fut, Err, Out> OutboundUpgrade<C> for FromFnUpgrade<P, F>
where P: ProtocolName + Clone, F: FnOnce(C, Endpoint) -> Fut, Fut: Future<Output = Result<Out, Err>>,

Source§

type Output = Out

Source§

type Error = Err

Source§

type Future = Fut

Source§

impl<C, T> OutboundUpgrade<C> for OptionalUpgrade<T>
where T: OutboundUpgrade<C>,

Source§

impl<C, U, F> OutboundUpgrade<C> for MapInboundUpgrade<U, F>
where U: OutboundUpgrade<C>,

Source§

impl<C, U, F> OutboundUpgrade<C> for MapInboundUpgradeErr<U, F>
where U: OutboundUpgrade<C>,

Source§

impl<C, U, F, T> OutboundUpgrade<C> for MapOutboundUpgrade<U, F>
where U: OutboundUpgrade<C>, F: FnOnce(U::Output) -> T,

Source§

type Output = T

Source§

type Error = <U as OutboundUpgrade<C>>::Error

Source§

type Future = MapFuture<<U as OutboundUpgrade<C>>::Future, F>

Source§

impl<C, U, F, T> OutboundUpgrade<C> for MapOutboundUpgradeErr<U, F>
where U: OutboundUpgrade<C>, F: FnOnce(U::Error) -> T,

Source§

type Output = <U as OutboundUpgrade<C>>::Output

Source§

type Error = T

Source§

type Future = MapErrFuture<<U as OutboundUpgrade<C>>::Future, F>