pub struct RawResponse { /* private fields */ }Expand description
Raw HTTP response with status code and body access
Implementations§
Source§impl RawResponse
impl RawResponse
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Check if the response status is a success (2xx)
Sourcepub fn is_client_error(&self) -> bool
pub fn is_client_error(&self) -> bool
Check if the response status is a client error (4xx)
Sourcepub fn is_server_error(&self) -> bool
pub fn is_server_error(&self) -> bool
Check if the response status is a server error (5xx)
Sourcepub async fn json<T: DeserializeOwned>(self) -> Response<T>
pub async fn json<T: DeserializeOwned>(self) -> Response<T>
Get the response body as JSON
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RawResponse
impl !RefUnwindSafe for RawResponse
impl Send for RawResponse
impl Sync for RawResponse
impl Unpin for RawResponse
impl UnsafeUnpin for RawResponse
impl !UnwindSafe for RawResponse
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