pub struct SimpleResponse {
pub status_code: StatusCode,
pub headers: HeaderMap,
pub read: Pin<Box<dyn Send + AsyncRead + 'static>>,
pub url: Option<Url>,
}
Fields§
§status_code: StatusCode
§headers: HeaderMap
§read: Pin<Box<dyn Send + AsyncRead + 'static>>
§url: Option<Url>
Implementations§
Source§impl SimpleResponse
impl SimpleResponse
pub fn url_path_basename(&self) -> Option<String>
Source§impl SimpleResponse
impl SimpleResponse
pub fn generic_error(url: &str) -> Self
Sourcepub async fn into_err(self) -> StatusError
pub async fn into_err(self) -> StatusError
Converts the response into a StatusError
Sourcepub async fn json<T: DeserializeOwned>(&mut self) -> Result<T, AnyError>
pub async fn json<T: DeserializeOwned>(&mut self) -> Result<T, AnyError>
Deserializes the response body as JSON
Auto Trait Implementations§
impl Freeze for SimpleResponse
impl !RefUnwindSafe for SimpleResponse
impl Send for SimpleResponse
impl !Sync for SimpleResponse
impl Unpin for SimpleResponse
impl !UnwindSafe for SimpleResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more