[−][src]Struct hyper::client::conn::SendRequest   
The sender side of an established connection.
Methods
impl<B> SendRequest<B>[src] 
impl<B> SendRequest<B>pub fn poll_ready(&mut self) -> Poll<(), Error>[src] 
pub fn poll_ready(&mut self) -> Poll<(), Error>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, [src] 
impl<B> SendRequest<B> where
    B: Payload + 'static, pub fn send_request(&mut self, req: Request<B>) -> ResponseFuture[src] 
pub fn send_request(&mut self, req: Request<B>) -> ResponseFutureSends a Request on the associated connection.
Returns a future that if successful, yields the Response.
Note
There are some key differences in what automatic things the Client
does for you that will not be done here:
- Clientrequires absolute-form- Uris, since the scheme and authority are needed to connect. They aren't required here.
- Since the Clientrequires absolute-formUris, it can add theHostheader based on it. You must add aHostheader yourself before calling this method.
- Since absolute-form Uris are not required, if received, they will be serialized as-is.
Example
use futures::Future; use hyper::Request; // build a Request let req = Request::builder() .uri("/foo/bar") .header(HOST, "hyper.rs") .body(Body::empty()) .unwrap(); // send it and get a future back let fut = tx.send_request(req) .map(|res| { // got the Response assert!(res.status().is_success()); });
Trait Implementations
impl<B> Debug for SendRequest<B>[src] 
impl<B> Debug for SendRequest<B>Auto Trait Implementations
impl<B> Send for SendRequest<B> where
    B: Send, 
impl<B> Send for SendRequest<B> where
    B: Send, impl<B> Sync for SendRequest<B> where
    B: Send, 
impl<B> Sync for SendRequest<B> where
    B: Send, Blanket Implementations
impl<T> From for T[src] 
impl<T> From for Timpl<T, U> Into for T where
    U: From<T>, [src] 
impl<T, U> Into for T where
    U: From<T>, impl<T, U> TryFrom for T where
    T: From<U>, [src] 
impl<T, U> TryFrom for T where
    T: From<U>, type Error = !
🔬 This is a nightly-only experimental API.  (
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src] 
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>🔬 This is a nightly-only experimental API.  (
try_from)Performs the conversion.
impl<T> Borrow for T where
    T: ?Sized, [src] 
impl<T> Borrow for T where
    T: ?Sized, impl<T> BorrowMut for T where
    T: ?Sized, [src] 
impl<T> BorrowMut for T where
    T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src] 
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
    U: TryFrom<T>, [src] 
impl<T, U> TryInto for T where
    U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API.  (
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src] 
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>🔬 This is a nightly-only experimental API.  (
try_from)Performs the conversion.
impl<T> Any for T where
    T: 'static + ?Sized, [src] 
impl<T> Any for T where
    T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src] 
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API.  (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<T> Erased for T[src] 
impl<T> Erased for T