[][src]Struct fastly::http::request::SendError

pub struct SendError { /* fields omitted */ }

An error that occurred while sending a request.

While the body of a request is always consumed when sent, you can recover the headers and other request metadata of the request that failed using SendError::into_sent_req().

Implementations

impl SendError[src]

pub fn backend_name(&self) -> &str[src]

Get the name of the backend that returned this error.

pub fn into_sent_req(self) -> Request[src]

Convert the error back into the request that was originally sent.

Since the original request's body is consumed by sending it, the body in the returned request is empty. To add a new body to the request, use Request::with_body(), for example:

if let Err(e) = bereq.send("my_backend") {
    let new_body = Body::from("something new");
    let new_req = e.into_sent_req().with_body(new_body);
    new_req.send("my_other_backend")?;
}

Trait Implementations

impl Debug for SendError[src]

impl Display for SendError[src]

impl Error for SendError[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.