pub trait HttpResponse: Read + Debugwhere
Self: Sized,{
// Required methods
fn headers(&self) -> &HeaderMap;
fn status(&self) -> StatusCode;
fn error_for_status(self) -> Result<Self, Box<dyn Error>>;
}
Expand description
Represents the result of sending an HTTP request.
Modelled after reqwest::Response
.
Required Methods§
Sourcefn status(&self) -> StatusCode
fn status(&self) -> StatusCode
Obtain a copy of the response’s status.
Sourcefn error_for_status(self) -> Result<Self, Box<dyn Error>>
fn error_for_status(self) -> Result<Self, Box<dyn Error>>
Return an error if the response’s status is in the range 400-599.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.