pub fn send_request<RB, H>(
        self,
        head: H,
        body: RB,
    ) -> LocalBoxFuture<'static, Result<(ResponseHead, Payload), SendRequestError>>
    where
        H: Into<RequestHeadType> + 'static,
        RB: MessageBody + 'static,
        RB::Error: Into<Error>,
    {
        Box::pin(async move {
            match self {
                Connection::Tcp(ConnectionType::H1(conn)) => {
                    h1proto::send_request(conn, head.into(), body).await
                }
                Connection::Tls(ConnectionType::H1(conn)) => {
                    h1proto::send_request(conn, head.into(), body).await
                }
                Connection::Tls(ConnectionType::H2(conn)) => {
                    h2proto::send_request(conn, head.into(), body).await
                }
                _ => unreachable!(
                    "Plain Tcp connection can be used only in Http1 protocol"
                ),
            }
        })
    }
/// Send a request through connection.
Send a request through connection.
Send a request through connection .
pub fn send_request<RB, H>(
        self,
        head: H,
        body: RB,
    ) -> LocalBoxFuture<'static, Result<(ResponseHead, Payload), SendRequestError>>
    where
        H: Into<RequestHeadType> + 'static,
        RB: MessageBody + 'static,
        RB::Error: Into<Error>,
    {
        Box::pin(async move {
            match self {
                Connection::Tcp(ConnectionType::H1(conn)) => {
                    h1proto::send_request(conn, head.into(), body).await
                }
                Connection::Tls(ConnectionType::H1(conn)) => {
                    h1proto::send_request(conn, head.into(), body).await
                }
                Connection::Tls(ConnectionType::H2(conn)) => {
                    h2proto::send_request(conn, head.into(), body).await
                }
                _ => unreachable!(
                    "Plain Tcp connection can be used only in Http1 protocol"
                ),
            }
        })
    }
pub fn send_request < RB , H > ( self , head : H , body : RB , ) -> LocalBoxFuture < ' static , Result < ( ResponseHead , Payload ) , SendRequestError > > where H : Into < RequestHeadType > + ' static , RB : MessageBody + ' static , RB :: Error : Into < Error > , { Box :: pin ( async move { match self { Connection :: Tcp ( ConnectionType :: H1 ( conn ) ) => { h1proto :: send_request ( conn , head . into ( ) , body ) . await } Connection :: Tls ( ConnectionType :: H1 ( conn ) ) => { h1proto :: send_request ( conn , head . into ( ) , body ) . await } Connection :: Tls ( ConnectionType :: H2 ( conn ) ) => { h2proto :: send_request ( conn , head . into ( ) , body ) . await } _ => unreachable ! ( " " ) , } } ) }
Send a request through connection.
Send a request through connection .
self
head
H
body
RB
self
head
H
body
RB