pub fn send_request<B>(&self, request: Request<B>) -> (SendRequest<B, B::Data>, RecvResponse)
    where
        B: HttpBody + 'static,
        B::Error: Into<Box<dyn StdError + Send + Sync>> + Send + Sync,
    {
        let (open_send, open_recv) = oneshot::channel();
        let recv = RecvResponse::new(open_recv, self.0.clone());
        let send = SendRequest::new(open_send, self.0.clone(), request);

        (send, recv)
    }
/// Send a HTTP/3 request
///
/// This accepts a [`http::Request<B>`] and emits [`SendRequest<B, B::Data>`], that will resolve
/// when transmission is complete, and [`RecvResponse`], that will resolve when response headers
/// have been received and decoded.
///
/// Note that both of those futures can be polled concurrently, but the reception will hang
/// indefinitely if transmission is not polled.
///
/// # Example: GET request
/// ```
/// # use anyhow::Result;
/// use http::Request;
/// use quinn_h3::{client::Connection, Body};
///
/// async fn get_things(connection: &mut Connection) -> Result<()> {
///     let request = Request::get("https://example.com/things")
///         .body(Body::from(()))?;
///
///     // Send the request
///     let (send_request, recv_response) = connection.send_request(request);
///     send_request.await?;
///
///     // Receive the response
///     let mut response = recv_response.await?;
///     let body = response.body_mut().read_to_end().await?;
///
///     Ok(())
/// }
/// ```
///
/// [`http::Request<B>`]: https://docs.rs/http/*/http/request/index.html
/// [`SendRequest<B, B::Data>`]: struct.SendRequest.html
/// [`RecvResponse`]: struct.RecvResponse.html


Note that both of those futures can be polled concurrently, but the reception will hang
indefinitely if transmission is not polled.
Note that both of those futures can be polled concurrently but the reception will hang indefinitely if transmission is not polled .
pub fn send_request<B>(&self, request: Request<B>) -> (SendRequest<B, B::Data>, RecvResponse)
    where
        B: HttpBody + 'static,
        B::Error: Into<Box<dyn StdError + Send + Sync>> + Send + Sync,
    {
        let (open_send, open_recv) = oneshot::channel();
        let recv = RecvResponse::new(open_recv, self.0.clone());
        let send = SendRequest::new(open_send, self.0.clone(), request);
        (send, recv)
    }
pub fn send_request < B > ( & self , request : Request < B > ) -> ( SendRequest < B , B :: Data > , RecvResponse ) where B : HttpBody + ' static , B :: Error : Into < Box < dyn StdError + Send + Sync > > + Send + Sync , { let ( open_send , open_recv ) = oneshot :: channel ( ) ; let recv = RecvResponse :: new ( open_recv , self . 0 . clone ( ) ) ; let send = SendRequest :: new ( open_send , self . 0 . clone ( ) , request ) ; ( send , recv ) }
Send a HTTP/3 request
This accepts a [`http::Request<B>`] and emits [`SendRequest<B, B::Data>`], that will resolve
when transmission is complete, and [`RecvResponse`], that will resolve when response headers
have been received and decoded.
Send a HTTP / 3 request This accepts a [ ` http :: Request<B > ` ] and emits [ ` SendRequest<B B :: Data > ` ] that will resolve when transmission is complete and [ ` RecvResponse ` ] that will resolve when response headers have been received and decoded .
&self
request
Request<B>
example: get request
None
use anyhow::result;
use http::Request;
use quinn_h3::{client::Connection, Body}.



Send the request
let (send_request, recv_response) = connection.send_request(request);
send_request.await?.

Receive the response
let mut response = recv_response.await?;
let body = response.body_mut().read_to_end().await?.




use http :: Request ; use quinn_h3 :: { client :: Connection Body } . Send the request let ( send_request recv_response ) = connection . send_request ( request ) ; send_request . await? . Receive the response let mut response = recv_response . await? ; let body = response . body_mut () . read_to_end () . await? .