[−][src]Struct fastly::request::SendError
An error that occurred while sending a request.
In practice this error should arise very rarely, usually due to a misconfigured request. Most
errors that arise during the actual connection to the backend will be returned as Ok
values
with a 5xx status code response.
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 (represented by ()
). To add a new body to the request, use
Request::map()
, for example:
if let Err(e) = bereq.send("my_backend") { let new_body = Body::from("something new"); let new_req = e.into_sent_req().map(|()| new_body); new_req.send("my_other_backend")?; }
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for SendError
[src]
impl Send for SendError
[src]
impl Sync for SendError
[src]
impl Unpin for SendError
[src]
impl !UnwindSafe for SendError
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,