pub fn open_tunnel<H: Into<RequestHeadType> + 'static>(
        self,
        head: H,
    ) -> LocalBoxFuture<
        'static,
        Result<(ResponseHead, Framed<Connection<A, B>, ClientCodec>), SendRequestError>,
    > {
        Box::pin(async move {
            match self {
                Connection::Tcp(ConnectionType::H1(ref _conn)) => {
                    let (head, framed) = h1proto::open_tunnel(self, head.into()).await?;
                    Ok((head, framed))
                }
                Connection::Tls(ConnectionType::H1(ref _conn)) => {
                    let (head, framed) = h1proto::open_tunnel(self, head.into()).await?;
                    Ok((head, framed))
                }
                Connection::Tls(ConnectionType::H2(mut conn)) => {
                    conn.release();
                    Err(SendRequestError::TunnelNotSupported)
                }
                Connection::Tcp(ConnectionType::H2(_)) => {
                    unreachable!(
                        "Plain Tcp connection can be used only in Http1 protocol"
                    )
                }
            }
        })
    }
/// Send request, returns Response and Framed tunnel.
Send request, returns Response and Framed tunnel.
Send request returns Response and Framed tunnel .
pub fn open_tunnel<H: Into<RequestHeadType> + 'static>(
        self,
        head: H,
    ) -> LocalBoxFuture<
        'static,
        Result<(ResponseHead, Framed<Connection<A, B>, ClientCodec>), SendRequestError>,
    > {
        Box::pin(async move {
            match self {
                Connection::Tcp(ConnectionType::H1(ref _conn)) => {
                    let (head, framed) = h1proto::open_tunnel(self, head.into()).await?;
                    Ok((head, framed))
                }
                Connection::Tls(ConnectionType::H1(ref _conn)) => {
                    let (head, framed) = h1proto::open_tunnel(self, head.into()).await?;
                    Ok((head, framed))
                }
                Connection::Tls(ConnectionType::H2(mut conn)) => {
                    conn.release();
                    Err(SendRequestError::TunnelNotSupported)
                }
                Connection::Tcp(ConnectionType::H2(_)) => {
                    unreachable!(
                        "Plain Tcp connection can be used only in Http1 protocol"
                    )
                }
            }
        })
    }
pub fn open_tunnel < H : Into < RequestHeadType > + ' static > ( self , head : H , ) -> LocalBoxFuture < ' static , Result < ( ResponseHead , Framed < Connection < A , B > , ClientCodec > ) , SendRequestError > , > { Box :: pin ( async move { match self { Connection :: Tcp ( ConnectionType :: H1 ( ref _conn ) ) => { let ( head , framed ) = h1proto :: open_tunnel ( self , head . into ( ) ) . await ? ; Ok ( ( head , framed ) ) } Connection :: Tls ( ConnectionType :: H1 ( ref _conn ) ) => { let ( head , framed ) = h1proto :: open_tunnel ( self , head . into ( ) ) . await ? ; Ok ( ( head , framed ) ) } Connection :: Tls ( ConnectionType :: H2 ( mut conn ) ) => { conn . release ( ) ; Err ( SendRequestError :: TunnelNotSupported ) } Connection :: Tcp ( ConnectionType :: H2 ( _ ) ) => { unreachable ! ( " " ) } } } ) }
Send request, returns Response and Framed tunnel.
Send request returns Response and Framed tunnel .
self
head
H
self
head
H