[][src]Struct hyper::client::conn::SendRequest

pub struct SendRequest<B> { /* fields omitted */ }

The sender side of an established connection.


impl<B> SendRequest<B>[src]

pub fn poll_ready(&mut self) -> Poll<(), Error>[src]

Polls to determine whether this sender can be used yet for a request.

If the associated connection is closed, this returns an Error.

impl<B> SendRequest<B> where
    B: Payload + 'static, 

pub fn send_request(&mut self, req: Request<B>) -> ResponseFuture[src]

Sends a Request on the associated connection.

Returns a future that if successful, yields the Response.


There are some key differences in what automatic things the Client does for you that will not be done here:

  • Client requires absolute-form Uris, since the scheme and authority are needed to connect. They aren't required here.
  • Since the Client requires absolute-form Uris, it can add the Host header based on it. You must add a Host header yourself before calling this method.
  • Since absolute-form Uris are not required, if received, they will be serialized as-is.


use futures::Future;
use hyper::Request;

// build a Request
let req = Request::builder()
    .header(HOST, "hyper.rs")

// send it and get a future back
let fut = tx.send_request(req)
    .map(|res| {
        // got the Response

Trait Implementations

impl<B> Debug for SendRequest<B>[src]

Auto Trait Implementations

impl<B> Send for SendRequest<B> where
    B: Send

impl<B> Sync for SendRequest<B> where
    B: Send

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Erased for T